Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tunneling socket could not be established #39

Open
jamesmoriarty opened this issue Apr 20, 2018 · 11 comments
Open

tunneling socket could not be established #39

jamesmoriarty opened this issue Apr 20, 2018 · 11 comments

Comments

@jamesmoriarty
Copy link

jamesmoriarty commented Apr 20, 2018

Just recording this for any lost souls.

Error: tunneling socket could not be established, cause=connect EINVAL 0.0.31.144:80 - Local (0.0.0.0:0)

The following might work for something like curl but doesn't for request/ tunnel-agent:

http_proxy=127.0.0.1:3128 curl http://google.com

You need to add the protocol:

http_proxy=http://127.0.0.1:3128 curl http://google.com

So in summary:

http_proxy=<host>:<port> would become http_proxy=<protocol>://<host>:<port>

@shawn-tangsc
Copy link

i have the same problem .!

@Zim-b7
Copy link

Zim-b7 commented Mar 29, 2019

any luck in solving this issue?

@ParthPatwalaTA
Copy link

Solved error but here is one note for Ubuntu users.

This will only work in the current terminal. if you run following command and then use it other terminals then it won't work. This works for me so i'vent search for global access.

Steps:

$ env | grep -i proxy
$ export http_proxy=
$ export https_proxy=

After running these commands you will see this kind of output

https_proxy=
http_proxy=
socks_proxy=
ftp_proxy=

If you see this then you're good to go.

@CherryDT
Copy link

CherryDT commented Jul 22, 2019

Got the same thing but with slightly different IP:

RequestError: Error: tunneling socket could not be established, cause=connect ECONNREFUSED 0.0.34.184:80

Recording this here for Google since I didn't find anything at first.

I think where this comes from is that, as @jamesmoriarty pointed out, it expects a protocol, and hence localhost:8888 (in my case - from Fiddler) is read as protocol localhost and IP 8888 is (due to the widely used, yet inofficial, way of parsing IP addresses since 4.2BSD inet_aton) read as 0.0.34.184 (since 34*256+184=8888).

@chenqping
Copy link

Error: tunneling socket could not be established, cause=connect EINVAL 0.0.31.144:80 - Local (0.0.0.0:0)

Just recording this for any lost souls.

http_proxy=<host>:<port> worked with curl. request / tunnel-agent requires the protocol.

So http_proxy=proxy-host:8080 became http_proxy=http://proxy-host:8080.

Good it worked for me!

@nsigel
Copy link

nsigel commented Jan 3, 2021

I think where this comes from is that, as @jamesmoriarty pointed out, it expects a protocol, and hence localhost:8888 (in my case - from Fiddler) is read as protocol localhost and IP 8888 is (due to the widely used, yet inofficial, way of parsing IP addresses since 4.2BSD inet_aton) read as 0.0.34.184 (since 34*256+184=8888).

@chenqping Would you mind elaborating a bit? I'm having this issue with trying to use fiddler and tunnel but I'm not sure if I understand what you mean

@CherryDT
Copy link

CherryDT commented Jan 3, 2021

Include the protocol (http://).

@nsigel
Copy link

nsigel commented Jan 3, 2021

I'm still getting Error: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:80 when using

      httpsAgent: tunnel.httpsOverHttp({
        host: "http://127.0.0.1",
        port: 8888,
      }),
      proxy: false,

@CherryDT
Copy link

CherryDT commented Jan 3, 2021 via email

@chris-kt
Copy link

Error: tunneling socket could not be established, cause=connect EINVAL 0.0.31.144:80 - Local (0.0.0.0:0)

Just recording this for any lost souls.

http_proxy=<host>:<port> worked with curl. request / tunnel-agent requires the protocol.

So http_proxy=proxy-host:8080 became http_proxy=http://proxy-host:8080.

Bless you, kind sir

@wang1212
Copy link

It seems that the problem still exists when the protocol of the proxy address is socks5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants