nodejs / node-addon-api

Module for using Node-API from C++
MIT License
2.16k stars 460 forks source link

Ports not opening #731

Closed Syn9673 closed 4 years ago

Syn9673 commented 4 years ago

I have this code

function CreateWebServer() {
    http.post("/growtopia/server_data.php", function(req, res) {
        setTimeout(() => {
            res.send(`server|127.0.0.1\nport|17091\ntype|1\n#maint|Mainetrance message (Not used for now) -- NodeJS-GTPS\n\nbeta_server|127.0.0.1\nbeta_port|17091\n\nbeta_type|1\nmeta|localhost\nRTENDMARKERBS1001`)
        }, 750)
    });

    http.start(80)
    .then(() => console.log(`Growtopia webserver started at port 80`))
}

CreateWebServer()

setTimeout(() => {
  HostHandler.start()
}, 5000);

but i was wandering, why is only one being ran? It's not logging the webserver started. HostHandler.start() is the cpp binding that opens a server with enet on c++ side, while http is restana.

gabrielschulhof commented 4 years ago

@Alexander9673 a native addon does not seem to be involved in the code you posted. If you are having issues with Node.js' HTTP server, please create a new issue in the Node.js core repository at

https://github.com/nodejs/node/issues/new