TIL Determine which HTTP port is being used by a Phoenix app

• 1m read

I was recently starting a Phoenix server with port 0 which tells the OS to find a free local port but wanted to know what port it had chosen.

It turns out you can query the ranch config by the module name of your Phoenix Endpoint to get this information:

Screenshot