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

Abstract proxy implementation #1404

Closed
kevva opened this issue Feb 4, 2015 · 5 comments
Closed

Abstract proxy implementation #1404

kevva opened this issue Feb 4, 2015 · 5 comments
Labels
FeatureRequest Something to make

Comments

@kevva
Copy link

kevva commented Feb 4, 2015

Wouldn't it be good to abstract your proxy implementation into a separate module that people can make use of? Currently proxies is kind of a no man's land but with this module it just seems to work.

Sure, one could use request for everything but this module is pretty big and includes a lot of features which in many cases aren't needed.

@simov
Copy link
Member

simov commented Feb 4, 2015

Good point, although I think this should be refactored as part of the future request's plugin system (whatever that will be at the end), not exactly as a stand alone module in that sense.

@nylen
Copy link
Member

nylen commented Feb 4, 2015

Currently proxies is kind of a no man's land but with this module it just seems to work.

I'm really glad to read that :)


I'm not sure how much of this you already know, but there are two ways to ask a web server to proxy somewhere, rather than the regular GET / HTTP/1.1 request:

# Ask the server to retrieve the page for us
GET http://destination.com:port/path HTTP/1.1

# Ask the server to tunnel to the destination for us
CONNECT destination.com:port HTTP/1.1
# then, over the connection to the destination server:
GET /path HTTP/1.1

The first way is pretty simple (but not secure for HTTPS destinations), we just set the path option here and pass it to http[s].request here.

The second way is mostly handled by mikeal/tunnel-agent which we depend on.


In the future, I envision there being a request-base module containing the basic functionality and perhaps a couple of other tightly coupled things like streaming, and then request would take request-base and add in the standard feature modules like request-auth and perhaps request-proxy. So users would be able to compose their own set of features if they want something simpler.

Want to help us get there?

@kevva
Copy link
Author

kevva commented Feb 4, 2015

Yeah, I'm currently using the first way (somewhat) here. The reason I'm asking is because we need some reliable proxy support in got.

As for the future, yes, request would benefit greatly from being a bit more modular and make use of plugins. My biggest pain point with this is the loading time when requiring it. I'll help if I can find some time to read the code etc.

@stale
Copy link

stale bot commented Nov 23, 2018

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.

@stale stale bot added the stale label Nov 23, 2018
@reconbot reconbot added the FeatureRequest Something to make label Nov 23, 2018
@stale stale bot removed the stale label Nov 23, 2018
@reconbot
Copy link
Contributor

reconbot commented Apr 1, 2019

Request is now in maintenance mode and wont be merging any new features. Please see #3142 for more information.

@reconbot reconbot closed this as completed Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest Something to make
Projects
None yet
Development

No branches or pull requests

4 participants