mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Turbo Tunnel client and server.
The client opts into turbotunnel mode by sending a magic token at the beginning of each WebSocket connection (before sending even the ClientID). The token is just a random byte string I generated. The server peeks at the token and, if it matches, uses turbotunnel mode. Otherwise, it unreads the token and continues in the old one-session-per-WebSocket mode.
This commit is contained in:
parent
222ab3d85a
commit
70126177fb
6 changed files with 399 additions and 29 deletions
|
@ -6,6 +6,10 @@ package turbotunnel
|
|||
|
||||
import "errors"
|
||||
|
||||
// This magic prefix is how a client opts into turbo tunnel mode. It is just a
|
||||
// randomly generated byte string.
|
||||
var Token = [8]byte{0x12, 0x93, 0x60, 0x5d, 0x27, 0x81, 0x75, 0xf5}
|
||||
|
||||
// The size of receive and send queues.
|
||||
const queueSize = 32
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue