jhead / phantom

Use your own Minecraft server with your Xbox or PS4 and play with friends!
MIT License
610 stars 75 forks source link

Phantom on the same computer as server? #174

Open mberdev opened 8 months ago

mberdev commented 8 months ago

Hello,

I understand the general idea of phantom (proxy and making the remote server appear on the LAN) but as dumb as it might sound I can't seem to make it work in a specific configuration.

I'm trying to have phantom run on the same computer as the server itself. It's just to test the setup on my own computer at my friend's house. He's the one who has the PS4. Later, I'll have the server on my PC at home and I have yet to decide where I'll run phantom on his LAN.

So anyways, on my PC on his LAN I run the Bedrock server on 127.0.01 on port 19132. Then I run the Minecraft client still on my own PC. I connect to the server : 127.0.01:19132. It works.

Then I try to run phantom, still on my PC. phantom-windows.exe -server 127.0.0.1:19132

It fails because it says the port is used or something. I'm guessing it's because the server is already listening on that port on that same computer. So I stop my server, change its port to 19134, and restart it.

Then I run phantom again on 19132 phantom-windows.exe -server 127.0.0.1:19132

Phantom's terminal enters a weird infinite loop:

Starting up with remote server IP: 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Binding ping server to port 19132
←[90m9:12PM←[0m ←[32mINF←[0m Starting idle connection handler
←[90m9:12PM←[0m ←[32mINF←[0m Binding proxy server to: 0.0.0.0:61467
←[90m9:12PM←[0m ←[32mINF←[0m Listener starting up: 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Proxy server listening!
←[90m9:12PM←[0m ←[32mINF←[0m Once your console pings phantom, you should see replies below.
←[90m9:12PM←[0m ←[32mINF←[0m Starting 1 workers
←[90m9:12PM←[0m ←[32mINF←[0m Listener starting up: 0.0.0.0:61467
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 127.0.0.1:65145!
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Received LAN ping from client: 127.0.0.1:65145
←[90m9:12PM←[0m ←[32mINF←[0m New connection from client 127.0.0.1:65145 -> 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 192.168.1.124:65145!
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Received LAN ping from client: 192.168.1.124:65145
←[90m9:12PM←[0m ←[32mINF←[0m New connection from client 192.168.1.124:65145 -> 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 127.0.0.1:54217!
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Received LAN ping from client: 127.0.0.1:54217
←[90m9:12PM←[0m ←[32mINF←[0m New connection from client 127.0.0.1:54217 -> 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 127.0.0.1:54218!
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Received LAN ping from client: 127.0.0.1:54218
←[90m9:12PM←[0m ←[32mINF←[0m New connection from client 127.0.0.1:54218 -> 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 127.0.0.1:54219!
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Received LAN ping from client: 127.0.0.1:54219
←[90m9:12PM←[0m ←[32mINF←[0m New connection from client 127.0.0.1:54219 -> 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 127.0.0.1:54220!
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Received LAN ping from client: 127.0.0.1:54220
←[90m9:12PM←[0m ←[32mINF←[0m New connection from client 127.0.0.1:54220 -> 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 127.0.0.1:54221!
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Received LAN ping from client: 127.0.0.1:54221
←[90m9:12PM←[0m ←[32mINF←[0m New connection from client 127.0.0.1:54221 -> 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 127.0.0.1:54222!
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Received LAN ping from client: 127.0.0.1:54222
←[90m9:12PM←[0m ←[32mINF←[0m New connection from client 127.0.0.1:54222 -> 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 127.0.0.1:54223!
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Received LAN ping from client: 127.0.0.1:54223
←[90m9:12PM←[0m ←[32mINF←[0m New connection from client 127.0.0.1:54223 -> 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 127.0.0.1:54224!
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Received LAN ping from client: 127.0.0.1:54224
←[90m9:12PM←[0m ←[32mINF←[0m New connection from client 127.0.0.1:54224 -> 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 127.0.0.1:54225!
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132
←[90m9:12PM←[0m ←[32mINF←[0m Received LAN ping from client: 127.0.0.1:54225
←[90m9:12PM←[0m ←[32mINF←[0m New connection from client 127.0.0.1:54225 -> 0.0.0.0:19132
←[90m9:12PM←[0m ←[32mINF←[0m Opening connection to 127.0.0.1:19132 for new client 127.0.0
...
...
...

I don't know what to do about this. I saw that someone published a docker image with phantom on it, maybe that'd be the easiest way.

BadWolf22 commented 8 months ago

Been a while since I used Phantom, but isn't the -server <address> argument for the external server address? So after you changed your port, I think it should be -server 127.0.0.1:19134.

The infinite loop aspect of this is because it is opening a proxy connection to port 19132 (itself). So there is constantly a new connection to forward.

Ct560 commented 3 weeks ago

Did this ever get resolved? Having the same issue but the solution isn't working