The R UI is generating public URLs for each page that is displayed. Caddy is used in conjunction with DNS to make those URLs visible.
Caddy is used as a reverse proxy to map pgbwb.com and birdomatic.com URLs to running services inside our network. Much more about this at https://caddyserver.com/. Chatbots ala ChatGPT are a great help explaining what’s going on and getting it set up.
We use DNS to point pgbwb.com and birdomatic.com URLs to our external network address. Caddy maps what IP address and port those requests should be routed to based on the incoming URL.
For example:
prod.pgbwb.com might go to IP 192.168.1.222 port 8888
test.pgwbw.com might go to IP 192.168.1.223 port 8899
tiny.pgbwb.com might go to IP 192.168.1.224 port 8877
We also use our local rounter to point those URLs at the internal LAN IP address of our server to make that work *inside* the network. In our case we’re using the Host Mapping function to get the traffic to the right internal address. Once again, Caddy uses the incoming URL to determine which port that traffic should use.
The caddyfile (on GitHub) is where those mapping rules are maintained.
Assigning Ports
Two instances of the UI and one instance of the tiny_shiny script are started when the computer starts. The port numbers for all three processes are assigned in the command-line that’s embedded in the .plist files that starts each process. GitHub has examples of the three .plist files..

