Reputation: 1729
I am not able to start a server listening to port 1880. I tried this simple code in Node.js:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('Hello World!');
res.end();
}).listen(1880);
Which gives me the following error:
Error: listen EACCES: permission denied 0.0.0.0:1880
[90m at Server.setupListenHandle [as _listen2] (net.js:1283:19)[39m
[90m at listenInCluster (net.js:1348:12)[39m
[90m at Server.listen (net.js:1436:7)[39m
at Object.<anonymous> (C:\Users\mmueller\Desktop\test\test.js:6:4)
[90m at Module._compile (internal/modules/cjs/loader.js:956:30)[39m
[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)[39m
[90m at Module.load (internal/modules/cjs/loader.js:812:32)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:724:14)[39m
[90m at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)[39m
[90m at internal/main/run_main_module.js:17:11[39m
Emitted 'error' event on Server instance at:
[90m at emitErrorNT (net.js:1327:8)[39m
[90m at processTicksAndRejections (internal/process/task_queues.js:80:21)[39m {
code: [32m'EACCES'[39m,
errno: [32m'EACCES'[39m,
syscall: [32m'listen'[39m,
address: [32m'0.0.0.0'[39m,
port: [33m1880[39m
}
What I tried:
Still no success. With port 1881 it also doesn't work. So some port-range has no access. But with e.g. port 18800 it works.
What else can I do to figure out why I don't have access to listen to port 1880? What else could be blocking this port access if not firewall or anti virus software?
Upvotes: 2
Views: 1332
Reputation: 1729
I have found the issue: Hyper-V was reserving some ports on windows.
netsh int ip show excludedportrange protocol=tcp
Upvotes: 2