Browse Source

Added hostname to web example server

Paul-Louis Ageneau 5 years ago
parent
commit
c0ea85025b
1 changed files with 6 additions and 1 deletions
  1. 6 1
      examples/web/server.js

+ 6 - 1
examples/web/server.js

@@ -98,5 +98,10 @@ wsServer.on('request', (req) => {
   clients[id] = conn;
 });
 
-httpServer.listen(8000);
+const hostname = '127.0.0.1';
+const port = 8000;
+
+httpServer.listen(port, hostname, () => {
+  console.log(`Server listening on ${hostname}:${port}`);
+});