Code Monkey home page Code Monkey logo

Comments (14)

sindresorhus avatar sindresorhus commented on April 28, 2024 1

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.

avimar avatar avimar commented on April 28, 2024 1

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.

floatdrop avatar floatdrop commented on April 28, 2024

@radum is node-tunnel solving your issue? It seems like right solution to your problem for me.

from got.

sindresorhus avatar sindresorhus commented on April 28, 2024

@floatdrop Maybe we should just mention it in the docs?

from got.

floatdrop avatar floatdrop commented on April 28, 2024

@sindresorhus there is another module - tunnel-agent, which is used in request. I think it worth to mention them in readme πŸ‘

from got.

sindresorhus avatar sindresorhus commented on April 28, 2024

@floatdrop tunnel-agent looks like is just node-tunnel: request/tunnel-agent#2

from got.

floatdrop avatar floatdrop commented on April 28, 2024

@sindresorhus yeah, but with some patches. Hope they will be ported to node-tunnel soon.

from got.

radum avatar radum commented on April 28, 2024

@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.

floatdrop avatar floatdrop commented on April 28, 2024

@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.

radum avatar radum commented on April 28, 2024

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.

sindresorhus avatar sindresorhus commented on April 28, 2024

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.

vvo avatar vvo commented on April 28, 2024

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.

shinnn avatar shinnn commented on April 28, 2024

nodejs/node#1490

from got.

niknah avatar niknah commented on April 28, 2024

With the latest version of got...

got('https://sindresorhus.com', {
	agent: { http:tunnel, https:tunnel, http2:tunnel}
	})
});

from got.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.