Question
· Jul 31, 2017

How to programmatically obtain the URL for CSP application on a given server?

Hi, folks!

Suppose I have a CSP app, which provides some service.

And the code of my App knows the name of the CSP App in form: /myappname

How can I programmatically obtain the URL for CSP apps to send the full qualified link to the users(e.g. via email) of my app?

E.g. https://productionserver.com/myappname

Discussion (6)1
Log in or sign up to continue

 (in my case 192.168.56.1), whereas one would need 71.174.62.16

This means you try to get information that is stored in your router's and/or firewall's  (NAT, DHCP,... ) routing/mapping table.
I'd assume you need to use some utility of your OS using $ZF(-1,...) $ZF(-2,...) to get the outside view of the inside server

This might work inquiring nslookup on a DNS server outside your NAT, ...  Though I never tried it

I was thinking that $SYSTEM.INetInfo.LocalHostName()

might be of help... however, that just gives the local host name, in my case "J2EDDEMOEL".

So, I tried the result of $SYSTEM.INetInfo.HostNameToAddr($SYSTEM.INetInfo.LocalHostName())
but that gives me an address that is valid only within my local area network (in my case 192.168.56.1), whereas one would need 71.174.62.16 to get to my systems from outside of the local area.

In other words: if you're only accessing that application from your local area network, the above reference would give you a usable address for the web-reference, but otherwise, I'm not sure how you'd get that programmatically.