
The relay server is the back bone of the QSocket project. It is designed for relaying the incoming QSocket connections with high performance and scalability. The official relay instance for the QSocket project gate.qsocket.io
is available for public use totally free of charge. But we advise everyone to setup their own relays on their own infrastructure.
Benchmarks
A single qsr instance with a 2GB RAM and 1 CPU cores can handle between 30.000/45.000 simultaneous relay connections.
Installation
The qsocket-relay is still in beta stage. The source code will be available with the first major release. It will be directly deployable with heroku, google cloud, and aws.
Tool | Build From Source | Docker Image | Binary Release |
---|---|---|---|
qsr | go install github.com/qsocket/qsocket-relay@latest | Download | Download |
Usage
QSocket Protocol
QSocket connections are initiated with a knock sequence. Knock sequence is 20 bytes long and contains 128bit unique identifier, 1 byte checksum, and 3 byte peer identifier. After establishing a valid TLS connection, relay server expects a knock sequence for starting the QSocket session.
When the relay server receives a valid knock sequence it first checks the master relay table for the UID of the connecting peer, if the UID does not exists, it is added to the table and the client starts waiting a period of time for incoming relay requests from other peers. If there is a relay request waiting for the client key (UID), relay server creates a full duplex connection between two sockets.