vscode-restclient icon indicating copy to clipboard operation
vscode-restclient copied to clipboard

connection rejected

Open TheDrake94 opened this issue 4 years ago • 16 comments
trafficstars

The connection was rejected. Either the requested service isn’t running on the requested server/port, the proxy settings in vscode are misconfigured, or a firewall is blocking requests. Details: RequestError: connect ECONNREFUSED 127.0.0.1:3000. Immagine1

TheDrake94 avatar Jan 04 '21 00:01 TheDrake94

@FabrizioB94 could you confirm that your local machine is listening to the port 3000?

Huachao avatar Jan 07 '21 14:01 Huachao

I got the same error,but my error port is 443.

Error Message
The connection was rejected. Either the requested service isn’t running on the requested server/port, the proxy settings in vscode are misconfigured, or a firewall is blocking requests. Details: RequestError: connect ECONNREFUSED 127.0.0.1:443.

Version vscode 1.53.0 win10 rest Client 0.24.4

dwpeng avatar Feb 07 '21 12:02 dwpeng

I got the same error,but my error port is 443.

Error Message The connection was rejected. Either the requested service isn’t running on the requested server/port, the proxy settings in vscode are misconfigured, or a firewall is blocking requests. Details: RequestError: connect ECONNREFUSED 127.0.0.1:443.

Version vscode 1.53.0 win10 rest Client 0.24.4

It's worked suddenly !

dwpeng avatar Feb 07 '21 12:02 dwpeng

What did you do? I have the same problem

vahakanj avatar Sep 16 '21 06:09 vahakanj

I have the same problem:

GET http://localhost:3000 HTTP/1.1

will result in:

[Error - 11:28:29 AM] Failed to send request:
RequestError: The connection was rejected. Either the requested service isn’t running on the requested server/port, the proxy settings in vscode are misconfigured, or a firewall is blocking requests. Details: RequestError: connect ECONNREFUSED 127.0.0.1:3000.

The problem is, that the request to localhost gets changed to 127.0.0.1 which fails if the server was started with HOST=localhost. There is no problem if the request is done by e.g. curl http://localhost:3000

Quickfix: start the server with HOST=127.0.0.1

@DENGWENPENG can you fix this?

aheissenberger avatar Nov 09 '21 10:11 aheissenberger

I have the same problem:

GET http://localhost:3000 HTTP/1.1

will result in:

[Error - 11:28:29 AM] Failed to send request:
RequestError: The connection was rejected. Either the requested service isn’t running on the requested server/port, the proxy settings in vscode are misconfigured, or a firewall is blocking requests. Details: RequestError: connect ECONNREFUSED 127.0.0.1:3000.

The problem is, that the request to localhost gets changed to 127.0.0.1 which fails if the server was started with HOST=localhost. There is no problem if the request is done by e.g. curl http://localhost:3000

Quickfix: start the server with HOST=127.0.0.1

@DENGWENPENG can you fix this?

I install a proxy soft on my computer. when I close it,the restclient works again. So if you also install some proxy soft, i think it is a good idea to close it.

dwpeng avatar Nov 10 '21 05:11 dwpeng

I have the same problem: GET http://localhost:3000 HTTP/1.1 will result in:

[Error - 11:28:29 AM] Failed to send request:
RequestError: The connection was rejected. Either the requested service isn’t running on the requested server/port, the proxy settings in vscode are misconfigured, or a firewall is blocking requests. Details: RequestError: connect ECONNREFUSED 127.0.0.1:3000.

The problem is, that the request to localhost gets changed to 127.0.0.1 which fails if the server was started with HOST=localhost. There is no problem if the request is done by e.g. curl http://localhost:3000

Quickfix: start the server with HOST=127.0.0.1 @DENGWENPENG can you fix this?

I install a proxy soft on my computer. when I close it,the restclient works again. So if you also install some proxy soft, i think it is a good idea to close it.

I have a newly installed MacOS Montery with no proxy installed. The proxy settings in VS Code are empty. How can I help to debug this problem?

aheissenberger avatar Nov 10 '21 08:11 aheissenberger

Same problem here... Has some update?

AntonnyAGS avatar Mar 23 '22 18:03 AntonnyAGS

same issue here

ilyesarezki avatar Apr 18 '22 17:04 ilyesarezki

you must npm run server , good luck

IamAnh-Fe avatar Jun 26 '22 03:06 IamAnh-Fe

Personally, I came across this during my first training. It turned out that I just forgot to launch the project I was working with via express. The firewall requirement worked, and after getting permission, everything turned on!

mcatcher avatar Jun 26 '22 06:06 mcatcher

you must npm run server , good luck

Thanks! I've been stuck for a while and running 'npm run server' really helped, : )

shreyag234 avatar Sep 22 '22 15:09 shreyag234

My Wi-Fi has a firewall which blocks certain websites. Could this be the reason for this error? Since I have started the server. And is there anyway to fix this

UltraHackerDog avatar Nov 09 '22 07:11 UltraHackerDog

you must npm run server , good luck

Thanks! I've been stuck for a while and running 'npm run server' really helped, : )

This solved my issue too just now. Thank you!

anjapetry avatar Feb 15 '23 15:02 anjapetry

you must npm run server , good luck

thanks

it works :P

szzzdk avatar Jun 14 '23 07:06 szzzdk

The same thing happened to me, in case it helps you, remember that in the official documentation they add the hostname as a parameter.This taking into account that I use express, I have seen videos in which it works without it, does anyone know why?

ex.listen(PORT, "localhost", () => {
  console.log(`server listening on port http://localhost:${PORT}`)
})

karlosvas avatar Aug 08 '23 19:08 karlosvas