Which distributed phoenix application will the client connect to?

Hi, I’ve been using elixir for 6 months. There were some stuck points.
I have 2 running phoinex apps. Both are the same app.

for example
the first is pr@ running on port 4000
second one running on port 4001 is pr2@

my users use ws:// port to connect to phoinex socket

my problem is how do i distribute these socket connections between 2 applications

You need to set up a load balancer in front of the apps, it will have a strategy to balance the load and handle users to the correct apps accordingly.