Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Ability to specify port in -bind option #31

Closed
mcjon3z opened this issue Nov 17, 2019 · 5 comments
Closed

Feature request: Ability to specify port in -bind option #31

mcjon3z opened this issue Nov 17, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@mcjon3z
Copy link

mcjon3z commented Nov 17, 2019

In attempting to run phantom inside of docker on OSX (which does not have --net=host capabilities), not being able to specify a bind port which can be forwarded to the host prevents the application from running properly. Looking at the commit history, it appears that the static bind port functionality was removed in favor of a randomly generated port to provide for allowing multiple instances to run at once.

@jhead
Copy link
Owner

jhead commented Nov 24, 2019

Hey @mcjon3z, I'm not sure if it's possible to support phantom inside Docker on macOS. phantom needs to always bind to 19132 (ideally with SO_REUSEADDR/PORT set) to listen for broadcast packets on the LAN. This differs from a traditional port forward into a Docker container because the broadcast packets have a destination of x.x.x.255 rather than your device's actual IP address, so I'm not sure how to forward those down to the container.

If you have the time or patience and want to try to get it working and open a PR, I'm totally open to that.

@jhead jhead added the enhancement New feature or request label Nov 24, 2019
@mcjon3z
Copy link
Author

mcjon3z commented Nov 24, 2019

I’m definitely willing to help test. Unfortunately go is not a language I’m familiar with at all so I won’t be much help in actually writing the code. If you were writing in python I’d be all over it!

Possibly refactoring the code to allow a port to be assigned as a parameter and go random otherwise, then I could give it a shot from the docker side on OSX and linux to see if there is a differing result.

@jhead
Copy link
Owner

jhead commented Jan 4, 2020

Hey @mcjon3z, a -bind_port option has been added to phantom on the master branch. There's no release yet but you're welcome to clone the repo and run it manually to test if you want. Just remember that you'll need to forward both port 19132 and whichever port you manually specify for the proxy server, since phantom uses both to work properly.

@mcjon3z
Copy link
Author

mcjon3z commented Jan 6, 2020

Sounds good. I'm on the road next couple of weeks but I think I brought my iPad with me and can test using that. I'll let you know how it works. Thank you sir!

@mcjon3z
Copy link
Author

mcjon3z commented Jan 25, 2020

I finally got around to testing this some more and I was unable to get it working on docker without host networking (so no dice on docker for mac or with bind port forwarding). Works just fine inside of docker as long it is on a linux host using host networking which negates the need for a specifically defined bind port.

I spun up a dedicated minecraft docker VM and have it working using docker-compose with multiple minecraft instances and phantom proxying back to them and they are showing up as LAN games now.

Thanks for trying - possibly there will be another use case for the bind port flag that you added.

@mcjon3z mcjon3z closed this as completed Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants