Skip to content

Commit

Permalink
Only allow connections from 127.0.0.1 interface (security)
Browse files Browse the repository at this point in the history
Darien Pardinas Diaz authored and dpar39 committed May 13, 2024
1 parent 7594659 commit d21ab16
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": [],
5 changes: 2 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -81,14 +81,13 @@ function setupRestControl(context: vscode.ExtensionContext) {
const config = vscode.workspace.getConfiguration(SETTINGS_NAME);
const enabled = config.get<number | null>("enable");
if (enabled) {
const host = config.get<string | null>("host");
const port = config.get<number | null>("port");
const fallbackPorts = config.get<number[] | null>("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 {

0 comments on commit d21ab16

Please sign in to comment.