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

Possible to support alternative agents? #112

Open
tonybruess opened this issue Oct 17, 2023 · 5 comments
Open

Possible to support alternative agents? #112

tonybruess opened this issue Oct 17, 2023 · 5 comments
Assignees
Labels
t-tooling Issues with this label are in the ownership of the tooling team.

Comments

@tonybruess
Copy link

I'd like to use hpagent because it supports reusable sockets.

I tried passing in agent: { https: httpsAgent } but it was overridden / didn't work.

I'm wondering if this is easily feasible or if there's some limitation I'm overlooking. If there's no gotchas I'm happy to make a PR.

@B4nan
Copy link
Member

B4nan commented Oct 17, 2023

Feel free to PR this, I guess we just didn't think about such use case.

@vladfrangu
Copy link
Member

Hey, I'm looking into this issue right now, but can't seem to figure out how to test this... it also shouldn't be overriding your agent unless you also provided a proxyUrl in your got options.

Do you have a reproduction sample we could use? 🙏

@B4nan B4nan removed this from the 75th sprint - Tooling team milestone Nov 6, 2023
@gippy gippy added the t-tooling Issues with this label are in the ownership of the tooling team. label Nov 20, 2023
@Edoardopacino
Copy link

Edoardopacino commented Feb 5, 2024

I also have encountered this problem, if I send multiple requests to the same host, it should use the same socket instead of establishing connection to the proxy server every time.(hpagent doesn't seem to support http2).
(update: http2-wrapper's agent supports reusable sockets)

@tonybruess
Copy link
Author

tonybruess commented Feb 28, 2024

I took a look at this again and I think there are two separate issues that I didn't articulate well in my original report.

  1. agent is overridden if proxyUrl is specified. I understand now this is expected behavior, but I didn't understand this originally. Should we raise an exception or print a warning if both are specified?
  2. There is no built-in support for reusable sockets. Is this a feature the team would consider supporting? In the code I see the following comment: Sockets must not be reused, the proxy server may rotate upstream proxies as well. As a workaround I'm just manually specifying agent and not using proxyUrl.

Probably worth splitting this single issue into two separate issues depending on how you'd like to proceed.

@fduman
Copy link

fduman commented Apr 16, 2024

@tonybruess I set the "http2: false" then I could use the hpagent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-tooling Issues with this label are in the ownership of the tooling team.
Projects
None yet
Development

No branches or pull requests

6 participants