omjadas / hudsucker

Intercepting HTTP/S proxy
https://crates.io/crates/hudsucker
Apache License 2.0
205 stars 34 forks source link

WebSocket TLS not support ? #113

Closed songjiachao closed 3 months ago

songjiachao commented 3 months ago

Failed to handle WebSocket: URL error: TLS support not compiled in

omjadas commented 3 months ago

What features do you have enabled?

futurist commented 2 months ago

I've encountered the same problem, the error log is here:

2024-06-13T11:59:02.243872Z ERROR proxy{version=HTTP/1.1 method=CONNECT uri=nexus-websocket-a.intercom.io:443 client_addr=127.0.0.1:60373}:process_connect:serve_stream:proxy{version=HTTP/1.1 method=GET uri=https://nexus-websocket-a.intercom.io:443/pubsub/5-hktnJnGifTkJvkzro5L8IXAkr947nbOjwggIG3Plc16LDg5DtaDjwdD9Z5z8aD6I0q-uL3D7nU07YSzBKKlcTQsr4ox4rglA_74C?X-Nexus-New-Client=true&X-Nexus-Version=0.12.12&user_role=visitor client_addr=127.0.0.1:60373}:upgrade_websocket:websocket:handle_websocket:message_forwarder{context=ServerToClient { src: wss://nexus-websocket-a.intercom.io:443/pubsub/5-hktnJnGifTkJvkzro5L8IXAkr947nbOjwggIG3Plc16LDg5DtaDjwdD9Z5z8aD6I0q-uL3D7nU07YSzBKKlcTQsr4ox4rglA_74C?X-Nexus-New-Client=true&X-Nexus-Version=0.12.12&user_role=visitor, dst: 127.0.0.1:60373 }}: hudsucker: WebSocket message error: WebSocket protocol error: Reserved bits are non-zero
omjadas commented 2 months ago

@futurist, this is a different issue. Could you share the headers for the GET request? If I had to guess I would say permessage-deflate is specified in the Sec-WebSocket-Extensions header (this is not currently supported by tungstenite, which is used to handle websockets).

futurist commented 2 months ago

@omjadas yes the header exists: Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

omjadas commented 2 months ago

@omjadas yes the header exists: Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

I would recommend removing the header in handle_request and see if that fixes it.