Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Enable any Client to connect to my localhost and send /receive data from it.
Servers for Qt installer are currently down

Enable any Client to connect to my localhost and send /receive data from it.

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 320 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SlayH
    wrote on 20 May 2024, 06:24 last edited by
    #1

    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.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 20 May 2024, 07:00 last edited by
      #2

      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.

      (Z(:^

      1 Reply Last reply
      1
      • S SlayH has marked this topic as solved on 21 May 2024, 05:17

      1/2

      20 May 2024, 06:24

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved