Yes, root-rights are required to bind port <1024 to Linux. Therefore, if I run the following script using the sudo node script.js command, the server will listen to port 80.
const http = require('http'); const server = http.createServer(); server.listen(80); Now I need to raise the server using PubSubHubbub . If you run an example from the repo itself with root-rights, the server will not be accessible "outside", i.e. I can only access it locally. The code that raises the server in this library is:
PubSubHubbub.prototype.listen = function(port){ this.port = port; this.server = http.createServer(this._onRequest.bind(this)); this.server.on("error", this._onError.bind(this)); this.server.on("listening", this._onListening.bind(this)); this.server.listen(this.port); } Why, when raising the server in the library, it is impossible to bind the port "globally", even when running the script itself with root-rights?