A WebSocket server implementation.
This class implements a WebSocket server that can also support the high-level multiplayer API.
After starting the server ([method listen]), you will need to [method NetworkedMultiplayerPeer.poll] it at regular intervals (e.g. inside [method Node._process]). When clients connect, disconnect, or send data, you will receive the appropriate signal.
[b]Note:[/b] This class will not work in HTML5 exports due to browser restrictions.
Disconnects the peer identified by [code]id[/code] from the server. See [method WebSocketPeer.close] for more information.
Returns the IP address of the given peer.
Returns the remote port of the given peer.
Returns [code]true[/code] if a peer with the given ID is connected.
Returns [code]true[/code] if the server is actively listening on a port.
Starts listening on the given port.
You can specify the desired subprotocols via the "protocols" array. If the list empty (default), no sub-protocol will be requested.
If [code]true[/code] is passed as [code]gd_mp_api[/code], the server will behave like a network peer for the [MultiplayerAPI], connections from non-Godot clients will not work, and [signal data_received] will not be emitted.
If [code]false[/code] is passed instead (default), you must call [PacketPeer] functions ([code]put_packet[/code], [code]get_packet[/code], etc.), on the [WebSocketPeer] returned via [code]get_peer(id)[/code] to communicate with the peer with given [code]id[/code] (e.g. [code]get_peer(id).get_available_packet_count[/code]).
Stops the server and clear its state.
Emitted when a client requests a clean close. You should keep polling until you get a [signal client_disconnected] signal with the same [code]id[/code] to achieve the clean close. See [method WebSocketPeer.close] for more details.
Emitted when a new client connects. "protocol" will be the sub-protocol agreed with the client.
Emitted when a client disconnects. [code]was_clean_close[/code] will be [code]true[/code] if the connection was shutdown cleanly.
Emitted when a new message is received.
[b]Note:[/b] This signal is [i]not[/i] emitted when used as high-level multiplayer peer.