From 0d74c9b2fe69068fc6348e4aafe47c2999fbc152 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Tue, 3 Sep 2024 09:48:43 +0200 Subject: [PATCH] [WS] Clarify docs about connect_to_url being non-blocking Expanded Web platform limitations to include TLSOptions being unsupported. --- modules/websocket/doc_classes/WebSocketPeer.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/websocket/doc_classes/WebSocketPeer.xml b/modules/websocket/doc_classes/WebSocketPeer.xml index 238dd305368a..d2f80ce51b5a 100644 --- a/modules/websocket/doc_classes/WebSocketPeer.xml +++ b/modules/websocket/doc_classes/WebSocketPeer.xml @@ -60,8 +60,9 @@ - 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.