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
socket.gethostbyname(hostname) might not return a correct ip #6
Comments
It's showing my local LAN IP [and oddly has a hyphen and a 1 displayed in the first char slot, overlayed] |
Local LAN IP here as well. |
Okay I read more about it and the line is supposed to return your local IP. I wished that you could play this without any extra software, but it seems like only way to play this online is to use a VPN like Hamachi. (The hyphen is a different textsurface that I accidently left there) |
I haven't looked at the network code - but simple port forwarding for the hosting system is likely a solution. uPnP could be used to auto configure routers that have it enabled. Also, it should be fine on a LAN (lan parties are fun!) |
I'm using the same network framework that I used for a pygame cardgame half a year ago, Hamachi worked really well back then when I played it with my friends, but it's a hassle to download a VPN for this. I think port forwarding might be the way, i'll have to look into that. |
it looks like you're using socket and not specifying protocol, and I believe it defaults to TCP. So, fowarding TCP port 5555 on a give router to the LAN IP of the hosting PC at the router, and assuming PC has no local firewall, then connecting to the public IP of the router from the internet based client should just work. |
FYI - I'm looking at adding the option to automatically create the port forward if a users' router has upnp enabled. I found a nice bug in uPnPy library, which I have fixed. We may have to include my patched version in this project, as the maintainer seems a bit inactive. I'll also work on a guide for manual router config. |
Sounds incredible, looking forward to seeing this |
Ok - uPnP is an option, but not a GOOD option. I now have a GOOD option in the works. You'll like it. I'll tackle the networking for multiplayer without external VPN required, but it may be a week or two for me to have time. |
Take your time, I'm sure it's gonna be awesome. I'll be ironing out the multiplayer meanwhile |
Absolutely - keep pumping out cool new stuff. I'll do my best to smash this headache for you. |
I'm curious what's the plan? |
woesbot - the plan ran into troubles due to lack of support on windows for an underlying protocol I planned to bring in. However - i still have a plan. As of right now - adding unit tests to the network facing code. Soon thereafter - adding uPnP - it will help some. After that, introducing some interesting low level things [below socket]. I am network engineer by trade - quite familiar with all the options and all the corner cases users may present from a topology/connectivity standpoint. Join us in discord if you want more info, etc! |
Discord info is in the readme section :) |
Friend of mine checked the multiplayer tab and the ip text bar showed his local ip, even though it should be his public ipv4 address. ipv4 is crucial for the multiplayer. Can anyone check the tab and see if your correct ipv4 shows up?
The text was updated successfully, but these errors were encountered: