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

not work, proxy #1

Closed
ruslanx3m opened this issue Sep 9, 2020 · 3 comments
Closed

not work, proxy #1

ruslanx3m opened this issue Sep 9, 2020 · 3 comments

Comments

@ruslanx3m
Copy link

ruslanx3m commented Sep 9, 2020

not work .. freeze.

const axios = require('axios');
const SocksAgent = require('axios-socks5-agent');

const { httpAgent, httpsAgent } = new SocksAgent({ host: 'xx.xx.xx.xx', port: xxxx,  agentOptions: { keepAlive: true } });

axios
    .get('http://wtfismyip.com/json', { httpAgent, httpsAgent })
    .then(res => console.log(res.data))
    .catch(e => console.error(e));
@0x0a0d
Copy link
Owner

0x0a0d commented Sep 9, 2020

I just test again with tor and it still works.
If you get freeze, you should check socks5 for sure that it still opens

curl http://wtfismyip.com/json --socks5 127.0.0.1:9050
if your socks5 does not open and you dont want to freeze, you should add timeout to request config

axios
.get('http://wtfismyip.com/json', { httpAgent, httpsAgent, timeout: 30e3 })

@0x0a0d 0x0a0d closed this as completed May 30, 2021
@Cocophotos
Copy link

Hi,

Indeed, this issue occurred to me. This seems related to that issue: nodejs/node#37510 which seems to be a Node issue and a http(s)-socks-client issue.

Best,

@minhna
Copy link

minhna commented May 2, 2022

I have this "freeze" issue too. Node: v14.19.1, axios: v0.21.0. Problem solved with socks-proxy-agent package

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

4 participants