Opened 5 months ago

Closed 5 months ago

#2422 closed defect (fixed)

Handle WebSocket Upgrade

Reported by: zzz Owned by: zzz
Priority: minor Milestone: 0.9.39
Component: apps/i2ptunnel Version: 0.9.38
Keywords: Cc: Meeh, Zlatin Balevsky
Parent Tickets: Sensitive: no

Description

HTTP client/server proxies break WebSocket? Upgrade.

Client sends:

Origin: http://example.i2p
Connection: keep-alive, Upgrade
Upgrade: websocket

but Connection: is rewritten to Connection: close
Also, Origin: may or may not need to be rewritten for CORS checks to pass.

Server responds:

HTTP/1.1 101 Switching Protocols
Connection: upgrade
Upgrade: websocket

but Connection: is rewritten to Connection: close

client doesn't upgrade. not clear what happens after upgrade, if it's more headers or just data e.g. json. We can't just get rid of the header rewriting because we don't support HTTP/1.1 pipelining, so we must detect the upgrade case and do something different.

ref: https://en.wikipedia.org/wiki/HTTP/1.1_Upgrade_header
see also #1063
need to also tell i2pd

Subtickets

Change History (4)

comment:1 Changed 5 months ago by zzz

Milestone: undecided0.9.39
Owner: set to zzz
Status: newaccepted

Good answers here, see protocol handshake section: https://en.wikipedia.org/wiki/WebSocket

comment:2 Changed 5 months ago by Zlatin Balevsky

Cc: Zlatin Balevsky added; zlatinb removed

comment:3 Changed 5 months ago by zzz

Client-side fix in b6563731ee03f0798b5e8603f3a11ef02f81b2e7 to be 0.9.38-6
Server-side TODO

comment:4 Changed 5 months ago by zzz

Resolution: fixed
Status: acceptedclosed

Server side fix in 2bbcf3eb77c216d9aaac782855bbf1a9c4d13f4e 09.38-6

Note: See TracTickets for help on using tickets.