So I have a very simple express http server that returns simple html hosted on 127.0.0.1 and 6550 port that works perfectly in localhost. I will be sharing the code at the end of this post but I don't think it says much.
I want to reach this over my public ip adress but I can not (ERR_CONNECTION_TIMED_OUT). Port also shows closed when checked by online port checking tools.
I have a TP link TD-W9970 modem. This is port forwarding:
I am absolutely sure I am forwarding to the right local ip and using the right port:
I have noticed that my public ip that I get from google and the one I get from my routers WAN info is different.
My public ip from google : 85.107.**.13
My ip from WAN info from router panel : 100.108.1**.1
I think this may explain the problem?
Can you help me resolve this issue? Thank you
Express code:
const http = require("http");
const hostname = "127.0.0.1";
const port = 6550;
// Create HTTP server
const server = http.createServer((req, res) => {
// Set the response HTTP header with HTTP status and Content type
res.writeHead(200, {'Content-Type': 'text/plain'});
// Send the response body "Hello World"
res.end('Hello World\n');
});
// Prints a log once the server starts listening
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
})