Replies: 1 comment 2 replies
-
Proxying requests is a bit more convoluted than just sending them to the proxy server. The ProxyAgent was written for that purpose, use it. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently attempting to send concurrent requests through a proxy using
Pool
. However, when I utilizepool.request
, the server responds with a 301 redirect, whereas when I useProxyAgent
, the response is 200.Using pool client dispatcher
result:
Using a global agent dispatcher
result:
I noticed that the 301 redirects are taking me back to the same URL that I initially added to the path. Could someone please provide insights into why this discrepancy might exist and suggest if there is a better method for sending concurrent requests through a proxy? Any advice or alternative approaches would be greatly appreciated.
Edit:
My guess is that the server might be redirecting my requests to the HTTPS version of the page, possibly because the proxy I'm using is requesting a non-HTTPS page. Interestingly, this issue doesn't seem to arise when I use ProxyAgent.
Edit2:
When I add 443 port during
pool.request
The server replied with
400 The plain HTTP request was sent to HTTPS port
Therefore I can confirm the pool is requesting an HTTP page. It isn't an issue if I am not connecting through a proxy in the pool.
Beta Was this translation helpful? Give feedback.
All reactions