Function WebSocketClient.connectToUrl
Connects to the given URL requesting one of the given protocols as sub-protocol. If the list empty (default), no sub-protocol will be requested.
If true is passed as gd_mp_api, the client will behave like a network peer for the MultiplayerAPI, connections to non-Godot servers will not work, and dataReceived will not be emitted.
If false is passed instead (default), you must call PacketPeer functions (put_packet, get_packet, etc.) on the WebSocketPeer returned via get_peer(1) and not on this object directly (e.g. get_peer(1)).
You can optionally pass a list of custom_headers to be added to the handshake HTTP request.
Note: Specifying custom_headers is not supported in HTML5 exports due to browsers restrictions.
godot .core .defs .GodotError connectToUrl
(
const(String) url,
const(PoolArray!(godot.core.string.String)) protocols = PoolArray(godot_pool_string_array(0LU)),
const(bool) gd_mp_api = false,
const(PoolArray!(godot.core.string.String)) custom_headers = PoolArray(godot_pool_string_array(0LU))
) nothrow @nogc;