Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

WebSocketMultiplayerPeer

Inherits: MultiplayerPeer < PacketPeer < RefCounted < Object

Base class for WebSocket server and client.

Description

Base class for WebSocket server and client, allowing them to be used as multiplayer peer for the MultiplayerAPI.

Note: When exporting to Android, make sure to enable the INTERNET permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.

Properties

PackedStringArray

handshake_headers

PackedStringArray()

float

handshake_timeout

3.0

int

inbound_buffer_size

65535

int

max_queued_packets

2048

int

outbound_buffer_size

65535

PackedStringArray

supported_protocols

PackedStringArray()

Methods

Error

create_client ( String url, TLSOptions tls_client_options=null )

Error

create_server ( int port, String bind_address="*", TLSOptions tls_server_options=null )

WebSocketPeer

get_peer ( int peer_id ) const

String