The address is whatever your server IP address is plus the port you assigned it to use. For example http://192.168.1.100:8080. If internally you use DNS then you can use the server name plus port number like bigserver.somecompany.com:8080. In Xojo you can specify the port you want to use if the default 8080 is not available.
If you are using Xojo Cloud then the above probably does not apply.
The following code is for a Desktop app, but it should work on a Web app:
Var ipAll() As String
Var txtUrl As String
// This will create a list of all IP addresses on system NICs
For sNic As Integer = 0 To ( System.NetworkInterfaceCount - 1 )
ipAll.Add(System.NetworkInterface(sNic).IPAddress)
Next sNic
// This will output that list in human-readable format
Var YOUR_PORT_HERE As String = “80” // Set this to whatever port you’re listening on
For ip As Integer = 0 To ipAll.LastIndex
If txtUrl<>"" Then txtUrl = txtUrl + EndOfLine
txtUrl = txtUrl + "http://" + ipAll(ip) + If( YOUR_PORT_HERE<>”80”, ":" + YOUR_PORT_HERE, “” ) // Only display port if not HTTP default of 80
Next ip
I Tom,
Yep, but what I’m not seeing is how to get the “whatever your server IP address is” when I don’t know what machine my customer will install it on.
Typically, Xojo listens on all interfaces unless you specify one. But if you could provide more details of your code or which objects you’re using, it would help. Thanks!
Yeah, this seems pretty simple to me so I’m puzzled with why I can’t figure this out.
If I were to setup a TCP/IP socket I could get it’s address easily enough.
I would have hoped I could have gotten session.url or app.address or app.host etc.