cors-anywhere
cors-anywhere copied to clipboard
Error: connect ECONNREFUSED
Hi, I am trying to setup the CORS-Anywhere server and am facing this problem whenever I try to access a URL
//URL: http://localhost:1337/google.com (I use 8080 for tomcat)
Not found because of proxy error: Error: connect ECONNREFUSED
At first I got the Missing headers message, I tried 2 things:
- Remove the
requireHeader
option (ie set it tonull
) - Left the recommended
requireHeader
as-is and added them in thecreateServer
function
Both of them give the same error as shown above. Any help is appreciated. Thanks.
Is the network connection and DNS correctly configured on your server?
What would be the correct configuration? BTW I forgot to mention, I myself am behind a proxy. Hope it helps.
Depends on your Operating system. If this issue is caused by an incorrect DNS/network/firewall config, then the problem has nothing to do with this library. Any (Node.is) application would experience this issue. On Jun 27, 2015 8:46 PM, "blumonkey" [email protected] wrote:
What would be the correct configuration?
— Reply to this email directly or view it on GitHub https://github.com/Rob--W/cors-anywhere/issues/29#issuecomment-116116436 .
How do I set it right? I am running Ubuntu 14.04_x64.
Look in /etc/resolv.conf
, and ensure that nameservers are being specified. E.g. using Google's DNS servers:
nameserver 8.8.8.8
nameserver 8.8.4.4
Mine has a nameserver 127.0.1.1
. Anyways I believe it was the proxy that was giving the issue, I have implemented a simple http-server which just writes the content of a webpage to the reponse but it also returned the same error. I have followed this blog to configure the http modules for usage behind proxy: http://blog.shaunxu.me/archive/2013/09/05/semi-global-proxy-setting-for-node.js.aspx
I didn't try this yet on cors-anywhere
but I hope it will work.
Perhaps you(or I ;)) can add this as an enhancement -- Proxy-support. IDK, Just saying :)