WebServer In Xojo - how to make it "visible" to all devices from the same network?

I’m trying to incorporate (in a desktop mac app) a simple/light web server in Xojo … I’ve used the “WebServer” example as a base (because is perfect for my needs).
The only issue that I have is that the server is not “visible” to all devices from the same network. It works great on the same computer but other devices can’t connect to it.

Is there a way to make it available to all devices on the same (Wi-Fi) network?

P.S. I’m using this on a mac

As long as the server is listening on something other than localhost and you know the port number it’s running on you should be able to go to another machine and put the ipnumber:port into the browser and get a connection. If you have a firewall of some sort running on the same machine as the server you would need to punch a hole for the port the server is using.

Hello @KevinW … Thanks for your answer … this is exactly what I did … I’ve used the ipnumber:port (of the server device on another computer, … also, I have no firewall active) but it doesn’t work … I thought that I need to do something else …

It’s been a while since I’ve used the server socket, but I think there is a property that can be set which will determine what IP address it listens on. If it’s only listening on localhost then you might not be able to connect to it from another machine. Other than that, I can’t think of anything else off the top of my head.

Also be sure that you are not on a network that blocks intra-LAN traffic. For example, WiFi networks are sometimes configured as “Guest” which allows internet access but not intraLAN access. This is very desirable in some situations, like hotels, public hot spots, etc.

Note that this is different from a firewall per se, whether hardware based or software based. And it is a great first line of defense in public hotspots. But NOT when you need to be able to access other devices on the LAN.

I’ve zero experience with web apps in Xojo; just commenting from a generic network perspective.

1 Like