You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
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.
This commit is contained in:
@@ -156,7 +156,7 @@ void GDScriptLanguageProtocol::poll() {
|
||||
server->poll();
|
||||
}
|
||||
|
||||
Error GDScriptLanguageProtocol::start(int p_port) {
|
||||
Error GDScriptLanguageProtocol::start(int p_port, const IP_Address &p_bind_ip) {
|
||||
if (server == NULL) {
|
||||
server = dynamic_cast<WebSocketServer *>(ClassDB::instance("WebSocketServer"));
|
||||
ERR_FAIL_COND_V(!server, FAILED);
|
||||
@@ -165,6 +165,7 @@ Error GDScriptLanguageProtocol::start(int p_port) {
|
||||
server->connect("client_connected", this, "on_client_connected");
|
||||
server->connect("client_disconnected", this, "on_client_disconnected");
|
||||
}
|
||||
server->set_bind_ip(p_bind_ip);
|
||||
return server->listen(p_port);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user