r0wbrt / advertsieve

Transparent proxy server for content policy management
Other
1 stars 0 forks source link

HTTP Web sockets get redirected to the https server #18

Closed r0wbrt closed 6 years ago

r0wbrt commented 6 years ago

If a client sends a web socket request to the bridge server and that web socket request is over http, the websocket request gets sent to the https proxy server. This results in http websockets not working. The fix to this is nontrivial since the client only sends an http CONNECT request to the proxy. A quick and dirty solution involves reading the port number of the connect request. If the port number is 443 then redirect to the TLS server. If the port number is 80, proxy as usual. However, these assumptions break URL's where the port is specified so a more robust solution might be to do protocol sniffing to determine if the request is a HTTP connection or a TLS connection.

Might also be of merit to investigate if the host header has this port information.

r0wbrt commented 6 years ago

38ad76ba2376d57250abd97bd442318879e53084