diff options
author | Zae <zaevi@live.com> | 2022-11-03 14:29:39 +0800 |
---|---|---|
committer | Zae <zaevi@live.com> | 2022-11-03 14:29:39 +0800 |
commit | 0a1a40e6ebdbf018efd8dbb92a61c6c2867af2a0 (patch) | |
tree | 251b688ec4db5d55081b28a2f477e893166c229e | |
parent | 889868cbbc8beac74d5f49f9b7ef41efc4ae7d5a (diff) |
Fix WebSocket connection failed on Web.
-rw-r--r-- | modules/websocket/emws_peer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/websocket/emws_peer.cpp b/modules/websocket/emws_peer.cpp index 3bd132bc73..eea015e486 100644 --- a/modules/websocket/emws_peer.cpp +++ b/modules/websocket/emws_peer.cpp @@ -95,6 +95,10 @@ Error EMWSPeer::connect_to_url(const String &p_url, bool p_verify_tls, Ref<X509C requested_url += ":" + String::num(port); } + if (!path.is_empty()) { + requested_url += path; + } + peer_sock = godot_js_websocket_create(this, requested_url.utf8().get_data(), proto_string.utf8().get_data(), &_esws_on_connect, &_esws_on_message, &_esws_on_error, &_esws_on_close); if (peer_sock == -1) { return FAILED; |