fix(mcp): bind HTTP+WS server to localhost only (#399)
This commit is contained in:
@@ -6,6 +6,7 @@ import { WebSocketServer } from 'ws'
|
|||||||
|
|
||||||
const EXT_ID = 'akldabonmimlicnjlflnapfeklbfemhj'
|
const EXT_ID = 'akldabonmimlicnjlflnapfeklbfemhj'
|
||||||
const STORE_URL = `https://chromewebstore.google.com/detail/page-agent-ext/${EXT_ID}`
|
const STORE_URL = `https://chromewebstore.google.com/detail/page-agent-ext/${EXT_ID}`
|
||||||
|
const LOOPBACK_HOST = 'localhost'
|
||||||
|
|
||||||
const launcherTemplate = readFileSync(
|
const launcherTemplate = readFileSync(
|
||||||
fileURLToPath(new URL('./launcher.html', import.meta.url)),
|
fileURLToPath(new URL('./launcher.html', import.meta.url)),
|
||||||
@@ -60,8 +61,8 @@ export class HubBridge {
|
|||||||
reject(err)
|
reject(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.#httpServer.listen(this.port, () => {
|
this.#httpServer.listen(this.port, LOOPBACK_HOST, () => {
|
||||||
console.error(`[page-agent-mcp] HTTP + WS on http://localhost:${this.port}`)
|
console.error(`[page-agent-mcp] HTTP + WS on http://${LOOPBACK_HOST}:${this.port}`)
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user