Networking over the Internet

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.
Post Reply
Arkathorn
Prole
Posts: 2
Joined: Thu Jun 16, 2016 11:35 pm

Networking over the Internet

Post by Arkathorn »

I'm trying to get started with networking, and I'm running into quite a few issues. I created a networking manager class using lua-enet, and it functions correctly when bound to different ports on the loopback address (127.0.0.1). However, any attempt to establish a connection between two different clients over the internet seems to fail. I assume that this is attributable to the limitations of UDP and router based networking. If so, it seems as though I would need a NAT punchthrough. If so, this would require a server accessible from both clients, with proper networking setup for the operation. Is there any way to accomplish this? Is LuaSocket less restricted than lua-enet? Am I completely wrong in my assumptions? Any information is helpful.
User avatar
pgimeno
Party member
Posts: 3684
Joined: Sun Oct 18, 2015 2:58 pm

Re: Networking over the Internet

Post by pgimeno »

I'm not sure if it's your issue, but are you binding to 127.0.0.1? if so, you can't connect from the outside; you need to bind to 0.0.0.0 or to your interface's IP address (on Linux, use ifconfig to find out which one it is, on Windows, use ipconfig, on OSX I have no idea).

You should be able to configure your router to forward TCP and/or UDP packets that come to a certain port, to any given IP and port (in this case your machine's local network IP; the WAN and LAN ports may be the same and that's commonly the case). I've seen that option called Virtual Servers in some routers; Port Redirection in others.
User avatar
4aiman
Party member
Posts: 262
Joined: Sat Jan 16, 2016 10:30 am

Re: Networking over the Internet

Post by 4aiman »

Port-forwarding may not be enough, though.
If you configure everything and the connection still won't work, your ISP may be the culpit.

When you'll be sure you've done everything right, ask it firmly to clarify not only whether any ports are closed, but (what's more important) whether your ISP had configured port forwarding on it's end.
Today many mobile ISPs claim to not block any ports but forget to clarify that they do not need block anything due to the configuration of their equipment.
Last edited by 4aiman on Sun Jun 19, 2016 8:02 am, edited 1 time in total.
Arkathorn
Prole
Posts: 2
Joined: Thu Jun 16, 2016 11:35 pm

Re: Networking over the Internet

Post by Arkathorn »

I cannot thank you enough for informing me of the 0.0.0.0 address. Networking is working now.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot] and 4 guests