Opened 3 weeks ago

Closed 3 weeks 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, zab
Parent Tickets:

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 3 weeks ago by zzz

  • Milestone changed from undecided to 0.9.39
  • Owner set to zzz
  • Status changed from new to accepted

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

comment:2 Changed 3 weeks ago by zab

  • Cc zab added; zlatinb removed

comment:3 Changed 3 weeks ago by zzz

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

comment:4 Changed 3 weeks ago by zzz

  • Resolution set to fixed
  • Status changed from accepted to closed

Server side fix in 2bbcf3eb77c216d9aaac782855bbf1a9c4d13f4e 09.38-6

Note: See TracTickets for help on using tickets.