Skip to content

Commit 9f36f3b

Browse files
committed
Merge pull request #99753 from Faless/ws/clarify_connect_noblock
[WebSocket] Clarify that `connect_to_url` is non-blocking
2 parents e60b184 + 95401f0 commit 9f36f3b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

modules/websocket/doc_classes/WebSocketPeer.xml

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
<param index="1" name="tls_client_options" type="TLSOptions" default="null" />
6262
<description>
6363
Connects to the given URL. TLS certificates will be verified against the hostname when connecting using the [code]wss://[/code] protocol. You can pass the optional [param tls_client_options] parameter to customize the trusted certification authorities, or disable the common name verification. See [method TLSOptions.client] and [method TLSOptions.client_unsafe].
64+
[b]Note:[/b] This method is non-blocking, and will return [constant OK] before the connection is established as long as the provided parameters are valid and the peer is not in an invalid state (e.g. already connected). Regularly call [method poll] (e.g. during [Node] process) and check the result of [method get_ready_state] to know whether the connection succeeds or fails.
6465
[b]Note:[/b] To avoid mixed content warnings or errors in Web, you may have to use a [param url] that starts with [code]wss://[/code] (secure) instead of [code]ws://[/code]. When doing so, make sure to use the fully qualified domain name that matches the one defined in the server's TLS certificate. Do not connect directly via the IP address for [code]wss://[/code] connections, as it won't match with the TLS certificate.
6566
</description>
6667
</method>

0 commit comments

Comments
 (0)