1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Custom headers support in WebSocketClient.

This commit also converts all PoolVector<String> parameters to
`const Vector<String>` in both WebSocketServer and WebSocketClient.
This commit is contained in:
Fabio Alessandrelli
2019-10-08 20:13:24 +02:00
parent c723a8b6aa
commit 67a4c3033b
10 changed files with 30 additions and 22 deletions

View File

@@ -64,11 +64,14 @@ EMSCRIPTEN_KEEPALIVE void _esws_on_close(void *obj, int code, char *reason, int
}
}
Error EMWSClient::connect_to_host(String p_host, String p_path, uint16_t p_port, bool p_ssl, PoolVector<String> p_protocols) {
Error EMWSClient::connect_to_host(String p_host, String p_path, uint16_t p_port, bool p_ssl, const PoolVector<String> p_protocols, const Vector<String> p_custom_headers) {
String proto_string = p_protocols.join(",");
String str = "ws://";
if (p_custom_headers.size()) {
WARN_PRINT_ONCE("Custom headers are not supported in in HTML5 platform.");
}
if (p_ssl) {
str = "wss://";
if (ssl_cert.is_valid()) {