From d21ab1643dff00f72098f222d881a23cc29aa349 Mon Sep 17 00:00:00 2001 From: Darien Pardinas Diaz Date: Mon, 13 May 2024 16:12:22 -0400 Subject: [PATCH] Only allow connections from 127.0.0.1 interface (security) --- package.json | 5 ----- src/extension.ts | 5 ++--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 5ced546..6c7220e 100644 --- a/package.json +++ b/package.json @@ -50,11 +50,6 @@ "default": 37100, "description": "Specifies the port on which the REST API server will start. If you are using multiple VSCode instances, it is best to set this in your workspace settings." }, - "restRemoteControl.host": { - "type": "string", - "default": "127.0.0.1", - "description": "Specifies the host to which the REST API server will bind." - }, "restRemoteControl.fallbacks": { "type": "array", "default": [], diff --git a/src/extension.ts b/src/extension.ts index a89e977..fb6d5e7 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -81,14 +81,13 @@ function setupRestControl(context: vscode.ExtensionContext) { const config = vscode.workspace.getConfiguration(SETTINGS_NAME); const enabled = config.get("enable"); if (enabled) { - const host = config.get("host"); const port = config.get("port"); const fallbackPorts = config.get("fallbacks"); startHttpServer( context, - host || "127.0.0.1", + "127.0.0.1", port || 37100, - (fallbackPorts || []).filter((p) => p !== port) + (fallbackPorts || []).filter((p: number) => p !== port) ); Logger.info("VSCode REST Control is now active!"); } else {