WebRTC Signaling Demo

An asset by Godot Engine
The page banner background of a mountain and forest
WebRTC Signaling Demo hero image

Quick Information

0 ratings
WebRTC Signaling Demo icon image
Godot Engine
WebRTC Signaling Demo

This is a WebSocket signaling server/client for WebRTC.All of it is implemented in Godot, though the signalling server has an alternative implementation using Node.js.Language: GDScriptRenderer: GLES 2

Supported Engine Version
3.4
Version String
3.4-b0d4a7c
License Version
MIT
Support Level
official
Modified Date
2 years ago
Git URL
Issue URL

A WebSocket signaling server/client for WebRTC.

This demo is devided in 4 parts:

  • The server folder contains the signaling server implementation written in GDScript (so it can be run by a game server running Godot)
  • The server_node folder contains the signaling server implementation written in Node.js (if you don't plan to run a game server but only match-making).
  • The client part contains the client implementation in GDScript.
    • Itself divided into raw protocol and WebRTCMultiplayer handling.
  • The demo contains a small app that uses it.

NOTE: You must extract the latest version of the WebRTC GDNative plugin in the project folder to run from desktop.

Language: GDScript

Renderer: GLES 2

Check out this demo on the asset library: https://godotengine.org/asset-library/asset/537

Protocol

The protocol is text based, and composed by a command and possibly multiple payload arguments, each separated by a new line.

Messages without payload must still end with a newline and are the following:

  • J: (or J: <ROOM>), must be sent by client immediately after connection to get a lobby assigned or join a known one. This messages is also sent by server back to the client to notify assigned lobby, or simply a successful join.
  • I: <ID>, sent by server to identify the client when it joins a room.
  • N: <ID>, sent by server to notify new peers in the same lobby.
  • D: <ID>, sent by server to notify when a peer in the same lobby disconnects.
  • S: , sent by client to seal the lobby (only the client that created it is allowed to seal a lobby).

When a lobby is sealed, no new client will be able to join, and the lobby will be destroyed (and clients disconnected) after 10 seconds.

Messages with payload (used to transfer WebRTC parameters) are:

  • O: <ID>, used to send an offer.
  • A: <ID>, used to send an answer.
  • C: <ID>, used to send a candidate.

When sending the parameter, a client will set <ID> as the destination peer, the server will replace it with the id of the sending peer, and rely it to the proper destination.

Screenshots

README Screenshot

This is a WebSocket signaling server/client for WebRTC.
All of it is implemented in Godot, though the signalling server has an alternative implementation using Node.js.

Language: GDScript

Renderer: GLES 2

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
WebRTC Signaling Demo icon image
Godot Engine
WebRTC Signaling Demo

This is a WebSocket signaling server/client for WebRTC.All of it is implemented in Godot, though the signalling server has an alternative implementation using Node.js.Language: GDScriptRenderer: GLES 2

Supported Engine Version
3.4
Version String
3.4-b0d4a7c
License Version
MIT
Support Level
official
Modified Date
2 years ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers