question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't request via localAdress and proxy simultaneously

See original GitHub issue

Summary

I have many interfaces on server, need to make requests via them and also using proxy, because proxy server has request limit per IP. Linux’s curl works fine, but I can’t make request via ‘request’

Simplest Example to Reproduce

request.get('https://api.ipify.org?format=json', {
	json: true,
	timeout: 4000
}, (error, response, body) => {
	console.log('1:', body)
})

request.get('https://api.ipify.org?format=json', {
	json: true,
	localAddress: 'my second local IP',
	timeout: 4000
}, (error, response, body) => {
	console.log('2:', body)
})

request.get('https://api.ipify.org?format=json', {
	json: true,
	proxy: 'proxy IP',
	timeout: 4000
}, (error, response, body) => {
	console.log('3:', body)
})

request.get('https://api.ipify.org?format=json', {
	json: true,
	localAddress: 'my second local IP',
	proxy: 'proxy IP',
	timeout: 4000
}, (error, response, body) => {
	console.log('4:', body)
})

Expected Behavior

My main IP is banned, so I expect to see logs from 1, 2 and 4. But I get only from 1 and 2. 4th don’t work, because localAdress is not applied.

curl --interface ‘second interface’ -x ‘proxy IP’ website This works fine

software version
request 2.85.0
node 9.2.0
npm 5.8.0
Operating System Ubuntu 14.04.5

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
malsatincommented, Apr 19, 2018

As this code is not extendible on client side I think that there is no soft variant (without maintainers intervention) of warkaround, other that paypass custom http.Agent to options (for example http-proxy-agent)

0reactions
stale[bot]commented, Apr 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proxy ARP – Definition and Use Cases - Practical Networking
Proxy ARP occurs when one node is responding to an ARP request on ... ARP Request does not know whether the response will...
Read more >
chimurai/http-proxy-middleware: The one-liner node ... - GitHub
In Express, this is the path relative to the mount-point of the proxy. path matching. createProxyMiddleware({...}) - matches any path, all requests will...
Read more >
This site can't be reached: how to solve - SupportHost
On Windows 10, just type 'proxy' in the search bar and open the proxy settings panel.
Read more >
PC Client can't connect to Internet - WinGate Forums • View topic
Have you tried to see if a proxy OR NAT connection works? ... and server's screens at the same time and work with...
Read more >
How To Configure Nginx as a Web Server and Reverse Proxy ...
In this tutorial you'll configure Nginx as both a web server and as a reverse proxy for Apache to host four domains on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found