Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: sip003 mux / multiplexing spec #262

Open
liudongmiao opened this issue Feb 29, 2024 · 1 comment
Open

feature request: sip003 mux / multiplexing spec #262

liudongmiao opened this issue Feb 29, 2024 · 1 comment

Comments

@liudongmiao
Copy link

liudongmiao commented Feb 29, 2024

There is no relay in sip003, currenty it's implemented by plugin self.

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:

  1. mux on payload, add mux header before payload
    1. Mux.Cool
    2. please note: it seems no way to compatible mux and non mux solution as mux header is not optional
  2. mux on plugin's underlying protocol
    1. websockets based on http/1.1, use websockets's rsv and/or opcode.
      1. please note, there should be some simple stream flow control
    2. http2/http3, special stream and stream flow control
    3. other: I don't think other protocol can be supported by cdn
@liudongmiao
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant