summaryrefslogtreecommitdiffstats
path: root/modules/websocket/websocket_client.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-10-08 20:13:24 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-10-09 13:53:04 +0200
commit67a4c3033bd4c5e6f61b5ff77709f60512392ab0 (patch)
treed20c5123fa2cf2f6ff3a4f3fba2138f1071cc955 /modules/websocket/websocket_client.cpp
parentc723a8b6aa2e32f0c8b213303610a35d08b01e34 (diff)
downloadredot-engine-67a4c3033bd4c5e6f61b5ff77709f60512392ab0.tar.gz
Custom headers support in WebSocketClient.
This commit also converts all PoolVector<String> parameters to `const Vector<String>` in both WebSocketServer and WebSocketClient.
Diffstat (limited to 'modules/websocket/websocket_client.cpp')
-rw-r--r--modules/websocket/websocket_client.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/websocket/websocket_client.cpp b/modules/websocket/websocket_client.cpp
index df6578e8bb..8bbd5aa37f 100644
--- a/modules/websocket/websocket_client.cpp
+++ b/modules/websocket/websocket_client.cpp
@@ -40,7 +40,7 @@ WebSocketClient::WebSocketClient() {
WebSocketClient::~WebSocketClient() {
}
-Error WebSocketClient::connect_to_url(String p_url, PoolVector<String> p_protocols, bool gd_mp_api) {
+Error WebSocketClient::connect_to_url(String p_url, const Vector<String> p_protocols, bool gd_mp_api, const Vector<String> p_custom_headers) {
_is_multiplayer = gd_mp_api;
String host = p_url;
@@ -72,7 +72,7 @@ Error WebSocketClient::connect_to_url(String p_url, PoolVector<String> p_protoco
host = host.substr(0, p_len);
}
- return connect_to_host(host, path, port, ssl, p_protocols);
+ return connect_to_host(host, path, port, ssl, p_protocols, p_custom_headers);
}
void WebSocketClient::set_verify_ssl_enabled(bool p_verify_ssl) {
@@ -143,7 +143,7 @@ void WebSocketClient::_on_error() {
}
void WebSocketClient::_bind_methods() {
- ClassDB::bind_method(D_METHOD("connect_to_url", "url", "protocols", "gd_mp_api"), &WebSocketClient::connect_to_url, DEFVAL(PoolVector<String>()), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("connect_to_url", "url", "protocols", "gd_mp_api", "custom_headers"), &WebSocketClient::connect_to_url, DEFVAL(Vector<String>()), DEFVAL(false), DEFVAL(Vector<String>()));
ClassDB::bind_method(D_METHOD("disconnect_from_host", "code", "reason"), &WebSocketClient::disconnect_from_host, DEFVAL(1000), DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_connected_host"), &WebSocketClient::get_connected_host);
ClassDB::bind_method(D_METHOD("get_connected_port"), &WebSocketClient::get_connected_port);