Hello,
I'm trying to create a mutiplayer game using the library Sock.lua, this is working in local but I can't connect to the server through my public IP
Even with the given exemple Pong it isn't working...
Gonna have to supply some more information. Is there an error? If so, what is the error, if not, what exactly happens? Can you upload a .love of your game?
Sir_Silver wrote: ↑Mon May 07, 2018 5:54 pm
Gonna have to supply some more information. Is there an error? If so, what is the error, if not, what exactly happens? Can you upload a .love of your game?
There is no errors that's the problem, it's just seing "connecting" for a while and then "disconnected".
I attached my .love files (my code is maybe a bit messy) but it does not work as well with the exemple from the github repository of sock.lua.
Does "your IP address" start with 127 or 192.168?
If so, that's local, and the reason why it won't work, you'd need your public IP address.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Are other people able to connect but not yourself? If I recall correctly, I've had this same problem, (others can connect to my server but not me) and what would work for me was to use "localhost" as the ip I believe. Give that a shot perhaps?
IIRC, you cannot connect to a server on the same machine with a public IP address, if that makes sense. Any other IP can connect to you, but you have to connect to localhost or 127.0.0.1 if the server is on the same machine as the program trying to access it.
You can't connect with your public ip because your router probably doesn't support hairpinning. (if you are connecting from the same network)
Hairpinning is where a machine on the LAN is able to access another machine on the LAN via the external IP address of the LAN/router (with port forwarding set up on the router to direct requests to the appropriate machine on the LAN).