How can I pass my own http.agent in a request
See original GitHub issueI need to pass my own proxy agent in a request. Meaning, all the requests inside my application should use my customized agent which makes the requests pass through a proxy. Something similar to agent
object in http.request
. Is there a easy way to do it?
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
How can I pass my own http.agent in a request #1130 - GitHub
Passing the agent (result of superagent.agent() ) around is the right solution. It's like dependency injection. If you expect to modify behavior ...
Read more >Request: Specifying custom agent that can handle http & https
If you use agentOptions instead of passing an http(s).Agent instance, request will create an agent for you for each scheme that is used:...
Read more >User-Agent - HTTP - MDN Web Docs - Mozilla
The User-Agent request header is a characteristic string that lets servers and network peers identify the application, operating system, ...
Read more >Please explain how to use the new http.Agent - Google Groups
I'm trying to make hundreds of requests to different hosts and I don't know which is the best approach to handle a request...
Read more >Set a custom user agent | New Relic Documentation
To set a custom user agent, include an agent string in the HTTP header User-Agent. ... For the integration name, use a string...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we could add more cross-request customizability via
superagent.agent()
methods. That creates an instance that an app could safely change.I’d rather not have any global
superagent.on
, because then libraries couldn’t safely use superagent without risking interfering with each other.agreed, I want to put the cookies into (result of
superagent.agent()
and then put those cookies into the headersAuthorization
orX-CSRF
on all outbound HTTP requests.