When running any shiny app in RStudio Server, if I run the app in the viewer pane

and then click "Show in new window", I get a new browser tab whose URL is forwarded by RStudio Server to the host and port of the running shiny app. For example, if I run
> shiny::runApp('test')
Listening on http://127.0.0.1:7515
I can go to https://rstudio-server.example.com/p/626f2650/. The 626f2650 path appears to be some sort of hash mapping back to http://127.0.0.1:7515.
Is it possible determine what this hash is programmatically? For example, if I specify a new port
shiny::runApp('test', port = 33333)
how can I determine what xxxxxxxx is here? https://rstudio-server.example.com/p/xxxxxxxx/