Merge pull request #99753 from Faless/ws/clarify_connect_noblock

[WebSocket] Clarify that `connect_to_url` is non-blocking
This commit is contained in:
Rémi Verschelde 2024-12-02 17:20:43 +01:00
commit 9f36f3b573
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -61,6 +61,7 @@
<param index="1" name="tls_client_options" type="TLSOptions" default="null" />
<description>
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].
[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.
[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.
</description>
</method>