Skip to content

Commit

Permalink
[WS] Clarify docs about connect_to_url being non-blocking
Browse files Browse the repository at this point in the history
Expanded Web platform limitations to include TLSOptions being
unsupported.
  • Loading branch information
Faless committed Sep 3, 2024
1 parent 7c38376 commit 0d74c9b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/websocket/doc_classes/WebSocketPeer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@
<param index="0" name="url" type="String" />
<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] 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.
Starts connecting to the given [param url]. The connection process (including DNS resolution) is non-blocking. Use [method get_ready_state] to check the connection [enum State], and remember to call [method poll] regularly.
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] On the Web platform, TLS certificate validation is enforced by the browser, so the [param tls_client_options] can't be supported. Additionally to avoid mixed content warnings or errors 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>
<method name="get_close_code" qualifiers="const">
Expand Down

0 comments on commit 0d74c9b

Please sign in to comment.