RomM’s netplay feature lets you play retro games online with friends in real time. It uses WebRTC for peer-to-peer game data exchange, with RomM’s own Socket.IO server acting as the signaling layer that helps players find each other and establish direct connections.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rommapp/romm/llms.txt
Use this file to discover all available pages before exploring further.
How It Works
Room creation
The host player opens a ROM in the EmulatorJS player and creates a netplay room.
The room is registered in RomM’s Redis-backed room store with a unique session ID,
a room name, an optional password, and a configurable player cap (default: 4).
Signaling
RomM’s Socket.IO endpoint at
/netplay/socket.io acts as the signaling server.
It brokers the initial WebRTC handshake: players exchange ICE candidates, SDP
offers, and SDP answers through the server without any game data passing through it.Peer-to-peer gameplay
Once the WebRTC connection is established, game inputs, snapshots, and data
messages flow directly between players’ browsers — the RomM server is no longer
in the data path.
Enabling Netplay
Netplay is disabled by default. Enable it under theemulatorjs.netplay key in
your config.yml:
Configuring ICE Servers
WebRTC requires at least one STUN server to discover public IP addresses, and typically a TURN server to relay traffic when a direct peer-to-peer connection cannot be established (e.g. behind symmetric NAT). Configure your ICE servers underemulatorjs.netplay.ice_servers:
In restricted network environments (corporate firewalls, carrier-grade NAT,
strict home routers), a direct peer-to-peer WebRTC connection often cannot be
formed without a TURN relay server. If players cannot connect to each other,
ensure you have a reachable TURN server configured. Free-tier TURN credentials
are available from providers such as
Open Relay.
Playing with Friends
Create a room
Click the Netplay button in the player toolbar. Give the room a name and,
optionally, set a password to restrict who can join. The room is now listed
publicly for other users browsing the same ROM.
Share the room
Send the session ID or room name to your friends. They open the same ROM, click
Netplay, and select your room from the list.
All players must have the same ROM file — specifically, files with matching
content hashes. RomM uses the content hash to verify compatibility before
allowing players to join a room.
Room Management API
RomM exposes a REST endpoint to inspect currently open rooms for a given game. This is the same data the EmulatorJS player UI uses to populate the room list.List open rooms
session_id → room_info objects. Only rooms that are not yet
full and belong to the requested game are included.
Example response:
| Field | Description |
|---|---|
room_name | Human-readable name set by the room owner |
current | Number of players currently in the room |
max | Maximum number of players allowed (default: 4) |
player_name | Display name of the room owner |
hasPassword | Whether a password is required to join |
Socket.IO Events
The real-time room lifecycle is managed over the Socket.IO endpoint at/netplay/socket.io. The table below describes the events your client or the
EmulatorJS player exchanges with RomM’s netplay server.
| Event | Direction | Description |
|---|---|---|
open-room | Client → Server | Create a new netplay room |
join-room | Client → Server | Join an existing room by session ID |
leave-room | Client → Server | Voluntarily leave the current room |
users-updated | Server → Room | Broadcast updated player list to all room members |
webrtc-signal | Client ↔ Server ↔ Client | Relay ICE candidates, SDP offers, and SDP answers |
webrtc-signal-error | Client → Server | Report a WebRTC signaling error (no-op on server) |
data-message | Client → Room | Broadcast arbitrary game data to all other players |
snapshot | Client → Room | Broadcast a game state snapshot |
input | Client → Room | Broadcast controller input to all other players |
disconnect | Server | Player disconnected; room updated automatically |