Comments (14)
I don't really care about proxy support, but I would consider a good PR ;)
Maybe by using https://github.com/koichik/node-tunnel
from got.
For socks5 proxies, this package seems to work as a replacement for node-tunnel which only handles http proxies:
const got = require('got');
const SocksProxyAgent = require('socks-proxy-agent');
const proxyOptions = 'socks5://localhost:8080';
const tunnel = new SocksProxyAgent(proxyOptions);
got('https://sindresorhus.com', {
agent: tunnel
})
});
from got.
@radum is node-tunnel solving your issue? It seems like right solution to your problem for me.
from got.
@floatdrop Maybe we should just mention it in the docs?
from got.
@sindresorhus there is another module - tunnel-agent, which is used in request. I think it worth to mention them in readme 👍
from got.
@floatdrop tunnel-agent looks like is just node-tunnel: request/tunnel-agent#2
from got.
@sindresorhus yeah, but with some patches. Hope they will be ported to node-tunnel soon.
from got.
@floatdrop both node-tunnel and tunnel-agent work just fine, but my problem is not with got missing proxy support is with all the other modules using got and not implementing proxy support.
I've already had this conversation some time ago with @sindresorhus (kevva/download#13) and as he pointed out making every module downstream care about it doesn't work in real life because they suck and nobody cares about them but they are here to stay so IMHO I think proxy support should be handled by the low level modules that are actually doing the work.
Now HTTP(S)_PROXY
env vars are fairly common and most of us are using them as a standard across all major OS. As an example I think bower
had the same issues a long time ago and is using those env vars to make the requests as do many other modules anyways.
from got.
@radum thanks for linking this conversation. I agree with @sindresorhus, that it should be implemented in default agent. For example Go has support of HTTP_PROXY
(without HTTPS, lol), so Node should do it as well (but apparently it won't nodejs/node-v0.x-archive#1973).
from got.
Yeah the entire thing it's broken everywhere I know because I'm behind one and it's a pain everyday.
Python guys have done it also for their request version http://docs.python-requests.org/en/latest/user/advanced/#proxies as for Node, it should be part of core IMHO. Thanks for the alternatives and the doc update anyways.
from got.
I'm open to it, but it would need to be in a form of a good PR (preferably with as much code as possible in depending modules) with promise to continue maintaining it, as I'm not interested.
so Node should do it as well (but apparently it won't nodejs/node-v0.x-archive#1973).
That issue is old so someone could try again, but that person should make sure the new issue has a lot of good arguments and evidence of why it should be in core.
as for Node, it should be part of core IMHO
Agreed!
I do wonder why Node can't just use the system proxy settings.
from got.
I do wonder why Node can't just use the system proxy settings.
Now it's time to tackle this issue for good! :-)
from got.
from got.
With the latest version of got...
got('https://sindresorhus.com', {
agent: { http:tunnel, https:tunnel, http2:tunnel}
})
});
from got.
Related Issues (20)
- `Response<string>` returned rather than a json response HOT 2
- Is v13 still maintained/supported? HOT 1
- Hangs on revalidated response from cache
- Infinite redirection with special characters in the redirected URL HOT 1
- Support `servername` https option
- How to get traffic usage per request? HOT 1
- Is it possible to skip/disable normalization of a request body? HOT 1
- afterResponse fired 3 times on error HOT 3
- Getting the IP address for failed requests due to timeout
- Post request to API returns response code 500 (Internal Server Error) whereas CURL returns 200 status code HOT 2
- Timeouts are longer than expected HOT 1
- NPM Says: Types are not integrated HOT 1
- FormData getLength can error out when some file input is unknown stream.
- POSTs whose bodys are instances of createReadStream hang with latest node HOT 5
- Apply `applyDestroyPatch` for v11.x
- Stream report downloadProgress when redirects HOT 1
- Is TypeScript support outdated? HOT 1
- Good News for CJS
- afterResponse hook is not called after a retryWithMergedOptions() HOT 2
- HTTP2 with proxy doesn't work? (http2-wrapper)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from got.