summaryrefslogtreecommitdiff
path: root/modules/websocket/websocket_server.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-10-11 08:28:47 +0200
committerGitHub <noreply@github.com>2019-10-11 08:28:47 +0200
commitbe446038bb8231a16c1f1a915bab89f1b7e45368 (patch)
treec40d28f088ed4844d9e1bb0e9848b415438e73f9 /modules/websocket/websocket_server.h
parentbe0da31f7a2e91b211b556ead5f1529f4427441a (diff)
parent2c557787c119ac629085cba2455132f5b82553dc (diff)
Merge pull request #32683 from Faless/ws/improve_pr
WebSocket improvements, SSL server, custom headers.
Diffstat (limited to 'modules/websocket/websocket_server.h')
-rw-r--r--modules/websocket/websocket_server.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/websocket/websocket_server.h b/modules/websocket/websocket_server.h
index 83c0c10419..0b39f94473 100644
--- a/modules/websocket/websocket_server.h
+++ b/modules/websocket/websocket_server.h
@@ -31,6 +31,7 @@
#ifndef WEBSOCKET_H
#define WEBSOCKET_H
+#include "core/crypto/crypto.h"
#include "core/reference.h"
#include "websocket_multiplayer_peer.h"
#include "websocket_peer.h"
@@ -43,9 +44,13 @@ class WebSocketServer : public WebSocketMultiplayerPeer {
protected:
static void _bind_methods();
+ Ref<CryptoKey> private_key;
+ Ref<X509Certificate> ssl_cert;
+ Ref<X509Certificate> ca_chain;
+
public:
virtual void poll() = 0;
- virtual Error listen(int p_port, PoolVector<String> p_protocols = PoolVector<String>(), bool gd_mp_api = false) = 0;
+ virtual Error listen(int p_port, const Vector<String> p_protocols = Vector<String>(), bool gd_mp_api = false) = 0;
virtual void stop() = 0;
virtual bool is_listening() const = 0;
virtual bool has_peer(int p_id) const = 0;
@@ -62,6 +67,15 @@ public:
void _on_disconnect(int32_t p_peer_id, bool p_was_clean);
void _on_close_request(int32_t p_peer_id, int p_code, String p_reason);
+ Ref<CryptoKey> get_private_key() const;
+ void set_private_key(Ref<CryptoKey> p_key);
+
+ Ref<X509Certificate> get_ssl_certificate() const;
+ void set_ssl_certificate(Ref<X509Certificate> p_cert);
+
+ Ref<X509Certificate> get_ca_chain() const;
+ void set_ca_chain(Ref<X509Certificate> p_ca_chain);
+
virtual Error set_buffers(int p_in_buffer, int p_in_packets, int p_out_buffer, int p_out_packets) = 0;
WebSocketServer();