- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 615
Closed
Labels
QuestionQuestions related to proxy serverQuestions related to proxy server
Description
I started a proxy with command:
proxy.py --basic-auth username:password
I configured chrome proxy as below(Mac OSX):
type: Web Proxy(Http)
Host: my_host_server
Port: 8899(I use the default port)
Chekced Proxy Server Requires Password
and fill in
Username: username
Passowrd: password
I'm sure the firewall was disabled.
but still can NOT get traffic proxyed, the log of proxy server didnot show anything, just a Starting
:
[root@myProxyServer ~]# /opt/rh/rh-python36/root/usr/bin/proxy.py --basic-auth username:password
2019-09-25 02:31:02,691 - INFO - run:633 - Starting server on port 8899
am I missed something? can somebody help me out of configuration? Thanks in advance:)
Metadata
Metadata
Assignees
Labels
QuestionQuestions related to proxy serverQuestions related to proxy server
Projects
Milestone
Relationships
Development
Select code repository
Activity
abhinavsingh commentedon Sep 25, 2019
What version of Chrome are you using?
I am using Chrome
Version 77.0.3865.90
Mac. I just tried setting my system proxy settings to same as yours. For me Chrome popped up a basic auth dialog box, which disappeared as I was typing in the username / password, followed by another pop-up to access the system keychain. Hitting refresh, presented the popup dialog again (in-spite of username / password details in system preferences), this time I was fast and Chrome worked fine after I was able to enter username / password in pop-up dialog box. Chrome basic auth support is certainly broken.I also tried Firefox which has it's own proxy configuration dialog. Firefox worked without any issues, presented me a basic auth dialog (Firefox doesn't accept username / password in proxy config) and then the site.
I can guarantee that Basic authentication support certainly works :) You can also verify the same using Curl on command line:
[-]chrome proxy configuration [/-][+]Basic Auth with Chrome browser[/+][-]Basic Auth with Chrome browser[/-][+]Basic Auth support for Chrome browser[/+]cypress-zh commentedon Sep 25, 2019
I am using Chrome:
Version 77.0.3865.90 (Official Build) (64-bit)
, I tried thecurl
command and it shows:@abhinavsingh
abhinavsingh commentedon Sep 25, 2019
Looks like you are accessing
proxy.py
remotely. Are you listening on all interfaces? e.g.--hostname 0.0.0.0
(IPv4) or--hostname ::
(IPv6)abhinavsingh commentedon Sep 25, 2019
I am assuming passing right flags made it work for you. Closing this now, feel free to re-open if necessary.
cypress-zh commentedon Sep 26, 2019
@abhinavsingh Thanks for ur response.
I tried ur suggestion, changed to listen to all interfaces, and it seems it was doing the connection, see log below, and a new problem
ProxyAuthenticationFailed
came, I'm sure that I have input the right username and password as what I set simplest in server side:abhinavsingh commentedon Sep 26, 2019
cypress-zh commentedon Sep 26, 2019
No, it's happening using chrome surfing internet, my server side commands is:
proxy.py --basic-auth my_username:123456 --hostname 0.0.0.0
and there's no command on client side(Chrome).
abhinavsingh commentedon Sep 26, 2019
cypress-zh commentedon Sep 26, 2019
I tried
curl
, and it works perfectly. 😝Chome browser still can NOT pass authentication. Thanks for ur help I'll recheck my configuration.:)vikranth094 commentedon Feb 25, 2022
Issue is due to check for auth header length is not equal to 2 in /proxy/proxy.py/proxy/http/proxy/auth.py , chrome browser might have extra headers ,Please change the code in /proxy/proxy.py/proxy/http/proxy/auth.py as a fix,.
if len(parts) != 2
at line 34After removal of this check, browser auth worked
abhinavsingh commentedon Feb 26, 2022
@vikranth094 Thank you. Can you also share what exactly does browser end up sending? We can use the same as a test scenario too. You can anonymize any hashes etc. I am curious what exactly is being sent by browser.
vikranth094 commentedon Feb 27, 2022
I am not sure about browser, I was working with my android proxy client which had request format
String.format(Locale.ENGLISH, "CONNECT %s:%d HTTP/1.0\r\nProxy-Connection: keep-alive\r\nProxy-Authorization: Basic %sUser-Agent: %s\r\nX-App-Install-ID: %s\r\n\r\n", m_DestAddress.getHostName(), m_DestAddress.getPort(), Constant.auth, ProxyConfig.Instance.getUserAgent(), ProxyConfig.AppInstallID);
abhinavsingh commentedon Feb 27, 2022
Thank you for this piece of information. We'll address it and add necessary tests using your provided example. I'll try to also repro on an android device. Best.
vikranth094 commentedon Feb 27, 2022
Thanks Bro, Really cool project