python-proxy icon indicating copy to clipboard operation
python-proxy copied to clipboard

Is it possible to listen to http/https on same port?

Open myocytebd opened this issue 3 years ago • 1 comments

Is it possible to listen to http/https on same port? I could not get it to work.

/usr/local/bin/pproxy -l [scheme]://localhost:lport -r socks5://localhost:rport -vv --ssl ...

If scheme==http, https does not work. If scheme==http+ssl, http get does not work. If scheme==httponly+http+ssl, https does not work.

It is problematic because http_proxy/https_proxy is then pretty much useless. wget https:// cannot work with http+ssl; while curl/git https:// cannot work with http:// or httponly://. 3rd party shell install scripts, etc. cannot be used without significant modification.

myocytebd avatar Mar 22 '21 01:03 myocytebd

pproxy can only listen on a port having protocols with ssl or without ssl. Guessing a protocol wrapped in ssl/tls by peeking a few bytes is impossible. It is impossible to do that in pproxy. But you can listen on the same port like "http+socks+ss://" (without ssl) or "http+socks+ss+ssl://" (with ssl). The ssl should be established and then the protocol be guessed.

qwj avatar Mar 24 '21 08:03 qwj