Multiplayer using sock.lua | Can't host a server

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Quôzul
Prole
Posts: 15
Joined: Mon Apr 16, 2018 5:03 pm
Location: France
Contact:

Re: Multiplayer using sock.lua

Post by Quôzul »

It seems the problem is coming from my computer, I asked a friend to host a server and it worked :?
That's really strange :huh:

EDIT:
KayleMaster wrote: Tue May 08, 2018 9:53 am 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).
Sorry, I don't really understood what you said especially what hairpinning is.. but I port forwarded the corrects ports (22122) on my router with UDP and TCP protocols.
KayleMaster
Party member
Posts: 234
Joined: Mon Aug 29, 2016 8:51 am

Re: Multiplayer using sock.lua

Post by KayleMaster »

It doesn't matter that you portforward, if your router doesn't support that feature, you won't be able to connect from the same network via your external ip, that's how it works. And that's why it works when someone else is hosting the server, because he's now on a different network.
User avatar
pgimeno
Party member
Posts: 3656
Joined: Sun Oct 18, 2015 2:58 pm

Re: Multiplayer using sock.lua

Post by pgimeno »

Does it work if you host a server and your friend tries to connect to it?

If so, then it's what Kayle says: you can't connect to your LAN from your LAN via the external IP, because the external IP is only visible from the outside.

If not, the problem must be different (possibly the IP).
User avatar
Quôzul
Prole
Posts: 15
Joined: Mon Apr 16, 2018 5:03 pm
Location: France
Contact:

Re: Multiplayer using sock.lua

Post by Quôzul »

pgimeno wrote: Tue May 08, 2018 10:32 amDoes it work if you host a server and your friend tries to connect to it?
No, he can't connect to the server if I host it
User avatar
NotARaptor
Citizen
Posts: 59
Joined: Thu Feb 22, 2018 3:15 pm

Re: Multiplayer using sock.lua | Can't host a server

Post by NotARaptor »

Might be a long shot, but if your friend can host it and you can connect, but not vice-versa, check your firewall settings.
User avatar
Quôzul
Prole
Posts: 15
Joined: Mon Apr 16, 2018 5:03 pm
Location: France
Contact:

Re: Multiplayer using sock.lua | Can't host a server

Post by Quôzul »

NotARaptor wrote: Tue May 08, 2018 3:18 pm Might be a long shot, but if your friend can host it and you can connect, but not vice-versa, check your firewall settings.
I allowed the right port in my Windows firewall but it doesn't seems to work also :death:
leankyr
Prole
Posts: 6
Joined: Sun Nov 08, 2020 6:09 pm

Re: Multiplayer using sock.lua | Can't host a server

Post by leankyr »

I am also having the same problem. I have port forwarded my router. i have allows love2D through firewall but I cannot host whatsoever. Does anyone know the IP we need to use in order to host? Should it be the private IP or the public IP? The Best Results I got with hamachi but when I connect from another network it is too slow and i get disconnected often. Any Idea would be helpful! Thanks!
User avatar
Xii
Party member
Posts: 137
Joined: Thu Aug 13, 2020 9:09 pm
Contact:

Re: Multiplayer using sock.lua | Can't host a server

Post by Xii »

leankyr wrote: Fri Aug 06, 2021 6:34 pm Should it be the private IP or the public IP?
Generally always the public IP. Private IPs only work on the Local Area Network (LAN), i.e. only for computers connected to your modem/router.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 5 guests