summaryrefslogtreecommitdiff
path: root/modules/websocket/websocket_server.h
diff options
context:
space:
mode:
authorHoukime <qahmnatorA_Tprotonmail.com>2020-01-02 14:02:29 +0000
committerHoukime <qahmnatorA_Tprotonmail.com>2020-01-15 00:29:59 +0000
commite1a0ce5af94cdb77e689916e730a655ea0ec823c (patch)
tree94fbabb7139d1da2d8f4ab9cdf5f3c48cc39bf45 /modules/websocket/websocket_server.h
parent40f0649e5b02037cb4745c336170e1e5422467ed (diff)
Prevent GDScript language server from listening to external hosts by default
* Add bind_ip property to WebSocketServer defaulting to "*" (listen to everyone) * Set default for GDscript Language Server to listen only to localhost Fixes potential security issue with GDScript language server being exposed to the broad net by default. Since it is the server which primary usage is to provide utility to the local editor there is no need to expose it.
Diffstat (limited to 'modules/websocket/websocket_server.h')
-rw-r--r--modules/websocket/websocket_server.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/websocket/websocket_server.h b/modules/websocket/websocket_server.h
index bfdac11489..3ce4dbe711 100644
--- a/modules/websocket/websocket_server.h
+++ b/modules/websocket/websocket_server.h
@@ -41,6 +41,8 @@ class WebSocketServer : public WebSocketMultiplayerPeer {
GDCLASS(WebSocketServer, WebSocketMultiplayerPeer);
GDCICLASS(WebSocketServer);
+ IP_Address bind_ip;
+
protected:
static void _bind_methods();
@@ -67,6 +69,9 @@ 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);
+ IP_Address get_bind_ip() const;
+ void set_bind_ip(const IP_Address &p_bind_ip);
+
Ref<CryptoKey> get_private_key() const;
void set_private_key(Ref<CryptoKey> p_key);