PySocks icon indicating copy to clipboard operation
PySocks copied to clipboard

Fix bug in HTTP basic authentication

Open amirasaran opened this issue 5 years ago • 1 comments

Hi there,

I have a problem to establish a connection to proxy.py with HTTP proxy and authentication after checking issues I found basic authentication must be camelcase.

amirasaran avatar Oct 10 '20 06:10 amirasaran

Sample request for test

$ telnet xxx.xxx.xxx.xxx 8899
Trying xxx.xxx.xxx.xxx...
Connected to xxx.xxx.xxx.xxx.
Escape character is '^]'.
CONNECT alt4.gmail-smtp-in.l.google.com:25 HTTP/1.1
Host: alt4.gmail-smtp-in.l.google.com
Proxy-Authorization: basic dXNlcjpwYXNz

HTTP/1.1 407 Proxy Authentication Required
Proxy-agent: proxy.py v2.2.0
Proxy-Authenticate: Basic
Connection: close
Content-Length: 29
$ telnet xxx.xxx.xxx.xxx 8899
Trying xxx.xxx.xxx.xxx...
Connected to xxx.xxx.xxx.xxx.
Escape character is '^]'.
CONNECT alt4.gmail-smtp-in.l.google.com:25 HTTP/1.1
Host: alt4.gmail-smtp-in.l.google.com
Proxy-Authorization: Basic dXNlcjpwYXNz

HTTP/1.1 200 Connection established

220 mx.google.com ESMTP p67si5683406oig.195 - gsmtp

amirasaran avatar Oct 10 '20 06:10 amirasaran