Enable any Client to connect to my localhost and send /receive data from it.
-
Hi Everyone!!!!
I had created a chat application using QWebSocket and QWebSocketServer. For the server's app, I had used my localhost's iP using QHostAddress::LocalHost, the port 12345 and make the server listen to incoming connections and data sent to it. The client's app is connected to that same iP and port.
I had used QWebAssembly to make the application available on the web but the problem is, only clients that are connected to the same router or desktop as the server can send/receive data from it.
I would like to enable any client to connect to my local server and let them behave as if the client were on the same router or desktop.Does any body have an idea or had done something similar to this? A little help would be much appreciated.
-
You are likely behind a router running NAT (Network Address Translation), and also likely your IP address is semi-random (your ISP gives you a new IP address every time your router is restarted or connection drops, etc.). Plus very likely port 12345 is blocked by your router's firewall.
In order to make this work you need to have some publicly available, static IP address with network configured to allow communication on port 12345. How exactly to do this depends on your circumstances. Maybe you need to rent a server from some server room, or you can get a static IP from your ISP, or you can use some cloud provider like AWS. There are plenty of options to choose from, please read up on it. This is not a Qt-related issue; every service available on the Internet has to go through this.
-