elazarl / goproxy

An HTTP proxy library for Go
BSD 3-Clause "New" or "Revised" License
6.06k stars 1.1k forks source link

Cannot connect to HTTP websocket when performing TLS MitM #506

Closed dlski closed 2 months ago

dlski commented 1 year ago

In a typical MitM over CONNECT scenario there is possibility to override request schema from secure to insecure. Example: when using TLS MitM we can redirect https service to a local http server by request URL manipulation using OnRequest handler. But when there is a try to open websocket connection, there is an error - always secure TLS connection is enforced regardless to request URL schema. Fix in #505