Skip to main content

Client Networking (network-client)

This document describes how the network-client package connects to a network-server instance and the concrete APIs used from client-side code.

Overview

A client connects to a single server instance. The package uses one TCP/WebSocket control channel and can also negotiate a single WebRTC data channel for unreliable traffic. Client responsibilities in a game are typically:
  • Initiate a TCP connection and send control commands such as join, play, and input.
  • Optionally negotiate a WebRTC data channel for receiving server snapshots or sending low-latency updates.

Example

It works the same with UDP:

Notes