shadowsocks-org
shadowsocks-org copied to clipboard
feature request: sip003 mux / multiplexing spec
There is no relay in sip003, currenty it's implemented by plugin self.
-
v2ray-plugin: use Mux.Cool
-
Mux.Cool
can be turned off by setmux
to0
-
As it's shadowsocks is based on socks, entire payload can be encrypted, so there is no mux
solution on shadowsocks payload.
Then, the mux should be done on plugin:
- mux on payload, add mux header before payload
-
Mux.Cool
- please note: it seems no way to compatible mux and non mux solution as mux header is not optional
-
- mux on plugin's underlying protocol
-
websockets
based on http/1.1, use websockets's rsv and/or opcode.- please note, there should be some simple stream flow control
-
http2/http3
, special stream and stream flow control - other: I don't think other protocol can be supported by cdn
-
There is another simple mux by @IrineSistiana at https://github.com/IrineSistiana/simple-mux
However, it's not standard, and the head length is 7 bytes.
For websocket, the head length is maximum 14 bytes, however, if we don't support more than 2**16 = 64K, the client data frame is 6 or 8 bytes (including mask 4 bytes), and the server data frame is 2 or 4 bytes (without mask 4 bytes). For mux, we can use 3 rsv bits, can support max 8 channel, and there are 10 unused opcodes, can be max to 18. For close stream, I'd suggest a payload length 0, as it's illegal for underlyling data, they never send data in 0. For ping / pong, there're in websockets.