P2P Server Transport
Accepts an encrypted peer-to-peer connection from a P2P Client on another machine. It works like a TCP connection but needs no public IP or port forwarding: the two sides find each other through a relay server, try to connect directly (hole punching), and keep using the relay when that fails. Traffic is end-to-end encrypted (QUIC, TLS 1.3), so relays cannot read it. Both sides choose a codec for the data, as on TCP.
Setup:
- Open the Toolkit side panel and use the ED25519 Key Generator:
- Put its Secret Key (hex) into Secret Key. Keep it private, because anyone who has it can pose as this server. Reuse the same key so the server's address stays the same.
- Give its Public Key (hex) to whoever runs the client. This is the server's Endpoint ID; the server also logs it when it starts.
- Set a Password. The client must use the same one, and connections with a wrong password are rejected.
- Leave Relay URL empty to use the default relays, or pick a relay region close to both ends.
The server serves one client at a time. A new client that passes the password check replaces the current one, so a client that lost power can reconnect without waiting for the old session to time out.
Configuration reference
| Config ID | p2p_server_transport |
| Selected by | app_transport = "p2p_server_transport" |
| Platforms | Linux, Windows, Android |
| License | Premium |
Peer-to-peer QUIC transport accepting a single client
Listening Configuration:
- Secret Key: 32-byte secret key in base32-hex. Reusing the same key keeps the Endpoint ID stable so clients can keep dialing the same address. The corresponding Endpoint ID is logged at startup.
- Password: Required pre-shared secret. Both peers must match; otherwise the connection is rejected. Empty passwords are not accepted.
- Relay URL: Leave empty to use the default relays (cn + us), or paste one or more relay URLs separated by commas or whitespace.
Operating Mode:
- Only one active client at a time. A new connection that completes the password handshake immediately kicks the current client — the old QUIC connection is closed. This means a fresh client can take over even if the previous one power-failed and never sent a clean disconnect.
- Connections that fail the password handshake are rejected and never affect the active session.
- On every client switch or disconnect, stale decoder state is flushed before the next session starts.
- Uses p2p QUIC; hole punching is attempted automatically and falls back to relay forwarding.
- Each handshake is bounded by a 15s timeout, so half-open peers can't stall the accept loop.
| Setting | Key | Type | Default | Notes |
|---|---|---|---|---|
| Secret Key (ed25519, hex-encoded 32 bytes) | p2p_server_transport_secret_key | Text | "" | Required |
| Password | p2p_server_transport_password | Text | "" | Required |
| Relay URL | p2p_server_transport_relay_url | Text (with presets) | "" |
Setting details
Relay URL
Presets (any other value can be entered):
| Value | Label |
|---|---|
"https://us.cycbox.io/" | US |
"https://eu.cycbox.io/" | EU |
"https://cn.cycbox.com/" | CN |
Example config
Default values as they appear in a saved configuration (for example the JSON block at the end of a cycbox/examples/*.lua file). Settings detected at runtime are omitted.
{
"app": {
"app_transport": "p2p_server_transport"
},
"p2p_server_transport": {
"p2p_server_transport_secret_key": "",
"p2p_server_transport_password": "",
"p2p_server_transport_relay_url": ""
}
}