fix: make dashboard locally accessible only
This commit is contained in:
@@ -9,7 +9,8 @@ export class WebServer {
|
||||
|
||||
public static start(port?: number) {
|
||||
this.server = Bun.serve({
|
||||
port: port ?? (typeof env.PORT === "string" ? parseInt(env.PORT) : 3000),
|
||||
port: port ?? env.PORT,
|
||||
hostname: env.HOST,
|
||||
fetch: (req, server) => {
|
||||
const url = new URL(req.url);
|
||||
if (url.pathname === "/ws") {
|
||||
@@ -38,7 +39,7 @@ export class WebServer {
|
||||
},
|
||||
});
|
||||
|
||||
console.log(`🌐 Web server listening on http://localhost:${this.server.port}`);
|
||||
console.log(`🌐 Web server listening on http://${this.server.hostname}:${this.server.port} (Restricted to Local Interface)`);
|
||||
|
||||
// Start a heartbeat loop
|
||||
this.heartbeatInterval = setInterval(() => {
|
||||
|
||||
Reference in New Issue
Block a user