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:
David Fifield 2020-01-28 02:32:02 -07:00
parent 222ab3d85a
commit 70126177fb
6 changed files with 399 additions and 29 deletions

View file

@ -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