-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Ability to provide authorization when tunneling to another proxy #300
Comments
ok, made some progress: after realizing that the original proxy_pool plugin was not working (same
I know start getting some responses! but I don't get all the html: the curl command get stuck (times out) and ends with the following (partial response):
Increasing the number of bytes read (probably not recommended...) "fixes" it: Note that I get the same behaviour (incomplete response) with the original I tried Update: I just found this issue #292. I am pretty sure it is related. |
@saadtazi Yes, you are right. Incomplete response can happen for large response bodies. I wrote proxy pool example mostly for demonstration purposes. And it (proxy pool plugin) needs more work for production usage. #292 discusses a few approaches. You can use the short-term approach while @atsakiridis work this out. Let me know how it goes. Thank you!!!! PS: I am currently traveling till end of this month. If time permits I'll jump back into it. Unfortunately, currently I am not carrying my development machine. |
Thank you @abhinavsingh , and thanks for the "responsiveness". If by "short term" approach you mean "increase the number of bytes read", then it works great! I guess we can close this issue now that I was able to authenticate. And I can definitively wait for #292 to be fixed (no rush on my end...) One last question though: I am still wondering if the change I made to
to:
|
Yes it does make sense. Someone already reported about it and I think
someone sent a PR (which was merged), but I never got a chance to verify
it's correctness.
Sounds good to close this issue. As far as authorization is concerned, I
believe proxy auth should work seamlessly even with chain of proxies. Just
make sure proxy headers are not stripped or just add your own based upon
upstream proxy requirements.
Thank you!!!!
…On Wed, Mar 4, 2020, 12:15 AM Saad Tazi ***@***.***> wrote:
Thank you @abhinavsingh <https://github.com/abhinavsingh> , and thanks
for the "responsiveness".
If by "short term" approach you mean "increase the number of bytes read",
then it works great!
I guess we can close this issue now that I was able to authenticate. And I
can definitively wait for #292
<#292> to be fixed (no
rush on my end...)
One last question though: I am still wondering if the change I made to
rebuild_original_path() makes sense (seems to fix the original plugin
ProxyPoolPlugin... for me at least...):
from:
return (
request.url.scheme +
COLON + SLASH + SLASH +
request.host +
COLON +
bytes(request.port) +
request.path
)
to:
return (
request.url.scheme +
COLON + SLASH + SLASH +
request.host +
COLON +
bytes(str(request.port).encode("ascii")) + # <-- changed line
request.path
)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#300?email_source=notifications&email_token=AAA6Y4N4EFIJESW3D4PTJM3RFVF5FA5CNFSM4K773QCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENUVMWQ#issuecomment-594105946>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA6Y4JYEJDVQY2JDXIJNKDRFVF5FANCNFSM4K773QCA>
.
|
Thank you! |
Is your feature request related to a problem? Please describe.
I am using master branch.
I am trying to follow/modify the
ProxyPoolPlugin
in order to connect to some proxies that requires authentication. I am not sure if it is possible. One of the proxies I try to use is luminati. I am able to use it successfully using the following curl command or using requests python library.Here is what I tried:
In
before_upstream_connection()
, I am returning the server name and port in the following format:Then, I modified
handle_client_request()
to add theProxy-Authorization
header:I then started proxy.py:
Then I used curl:
curl -v -x localhost:8899 http://httpbin.org
I got the following curl output:
And the following logs in proxy.py:
I am obviously doing something wrong: notice the
None:None
.Note: issuing the following curl command works (after replacing with valid username/password):
curl -v --proxy zproxy.lum-superproxy.io:22225 --proxy-user valid-user:valid-password "http://lumtest.com/myip.json"
Note: I also tried to add username and password like this:
new_socket_connection("username:password@zproxy.lum-superproxy.io", 22225))
but I get the following error:Describe the solution you'd like
I am not sure how to provide proxy authentication for the final proxy.
Any help would be appreciated.
Thank you
The text was updated successfully, but these errors were encountered: