Nice! Thank you @Brett Saviano! 

And it works for host versions nicely! But of course if it is a docker image there could be a ports mapping. e.g. if I start iris with the following command:

docker run --rm --name iris-demo -d -p 9091:1972 -p 9092:52773   intersystemsdc/irishealth-community:preview

and open terminal with:

docker exec -it iris-demo iris session iris

then the command gives us:

USER>Do ##class(%Studio.General).GetWebServerPort(,,,.url) Write url,"csp/sys/UtilHome.csp" Kill url

http://172.17.0.2:52773/csp/sys/UtilHome.csp

and the working one is:

http://localhost:19092/csp/sys/UtilHome.csp

Maybe it is not possible at all for docker. 

Unless we setup a special global intentionally during the docker image build.