Home > Net >  Cannot get my Node.js server to receive HTTP request from cURL
Cannot get my Node.js server to receive HTTP request from cURL

Time:06-28

My server displays the output just fine on my browser (localhost:8000). I am running it on one terminal (vscode) and on another terminal (Ubuntu) I run the following command:

$ curl http://localhost:8000

The terminal waits and after a while displays:

curl: (28) Failed to connect to localhost port 8000: Connection timed out

I want to know why they are not connecting. There is nothing in the browser console (I am using Firefox).

CodePudding user response:

Working just fine now. I am able to use curl on ubuntu to pass any sort of request to server. This is what I tried:

  1. Turned firewalls off

  2. Found the WIFi's IPv4 address via ipconfig

  3. Curl works just fine on the other Ubuntu WSL terminal. I am able to PUT, DELETE etc.

Now no idea what happened. Exact same commands weren't producing the result last night.

  • Related