I use Phoenix to serve an API and I’ve been using it in development for many months now running it on port 4000 and a Node server (SSR React) on port 3000 that sends request to the Phoenix backend.
I noticed yesterday I was not being able to access the Phoenix server from other computers in the same network anymore but, oddly enough, the Node server is working normally. On the machine that runs the server I can access it normally (both using locahost and the local IP).
Things I tried:
Changing the port 4000 to other 4 digit numbers.
Run servers from different projects (new and existing ones) to compare what was different in terms of configuration—turns out I’m not able to access any Phoenix server from other machines anymore.
Delete mix.lock, run mix deps.clean --all
Explicity set http: [ip: {0, 0, 0, 0}, port: 4000] on endpoint config on config/dev.exs
I’m not at all versed on computer networks so any ideas on how to troubleshoot it would be very appreciated
I’ve been thinking of it and I can’t think of anything I’ve done differently yesterday… but it could be that it’s been like this for longer than I realized; I use accessing the server from different devices to test on mobile/tablet and I haven’t done that in while (perhaps a week). But I don’t think I upgraded anything.
What is odd to me is that this is happening across different Phoenix projects (different Phoenix versions, using different Elixir versions even). At first I though it could have been some config or library I changed, but since it’s happening to all projects past and present I’m assuming it’s not?
Btw, another thing I did try was to swap to a previous Elixir version (I’m using 1.14 and tried different 1.13 and 1.12 versions I still have on asdf)
This is embarrassing
But… as someone that knows nothing about networks, I’m confident to say I never came anywhere near these settings section. Is this something that programs can just change on your behalf?
Also, is it normal for the same application to have 4 entries there?
macOS asks you when you first start a new application (or maybe when it first tries to bind to a socket?) if you want to allow or block incoming connections.
Those are probably not the same application in the OS’s PoV. Maybe the same or different BEAM instance but run from different folders with different arguments. But I’m no macOS firewall expert.