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)
- Outdated How to store options section?
- Switch proxy before retry?
- unexpected output to console from post
- The requested module 'get-stream' does not provide an export named 'buffer'
- tsc can't resolve types for got 13 HOT 40
- Incorrect types on hook options?
- Why does the HTTPError constructor only use three fields of the PlainResponse HOT 1
- Got breaks when secure renegotiation is not supported by remote resource
- Wrong type for retry option HOT 1
- `afterResponse` hook throws error on an endpoint that returns `null` when setting `responseType: 'json'`
- GOAWAY/Stream error retries not working consistently
- Catch ECONNREFUSED Error HOT 5
- response.socket.getProtocol() returns null
- Useless stack traces in got@11 HOT 4
- How to go about typing handlers?
- DNs Lookup for IP Address
- Why not CJS? HOT 1
- `stream.timings.end` property may be undefined depending on host
- Make another promise including witness and a proof agreement βprintβ HOT 2
- [V11] Update `body` error if data contains Unicode characters HOT 1
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.