A problem with Sock.lua library

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
User avatar
SkippyDip
Prole
Posts: 3
Joined: Thu Oct 10, 2019 7:40 pm

A problem with Sock.lua library

Post by SkippyDip »

Hi, I have this problem that might sound stupid but I've been stuck with it for a long while now.
I am using a library called Sock.lua (https://github.com/camchenry/sock.lua) and I have a problem with public host/self-hosting

Code: Select all

server = sock.newServer("IP HERE", 22122)
What IP do I use? I tried my public IP and it gave this error:
Failed to create the host. is there another server running on 22122?
I can local-host fine but I can't public-host..
Please help, thx. :awesome:
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: A problem with Sock.lua library

Post by raidho36 »

Address indicates on which IP the server is going to run. You usually want to use asterisk ( "*" ) or "localhost" for server IP when you create it.
User avatar
pgimeno
Party member
Posts: 3548
Joined: Sun Oct 18, 2015 2:58 pm

Re: A problem with Sock.lua library

Post by pgimeno »

"*" fails with some libraries on some systems. 0.0.0.0 should work fine across platforms. localhost is not guaranteed to work for anything other than your own computer.
User avatar
SkippyDip
Prole
Posts: 3
Joined: Thu Oct 10, 2019 7:40 pm

Re: A problem with Sock.lua library

Post by SkippyDip »

But I wanna make it so people around the world can connect to the server/IP, I don't want to localhost.
User avatar
pgimeno
Party member
Posts: 3548
Joined: Sun Oct 18, 2015 2:58 pm

Re: A problem with Sock.lua library

Post by pgimeno »

Use 0.0.0.0
User avatar
SkippyDip
Prole
Posts: 3
Joined: Thu Oct 10, 2019 7:40 pm

Re: A problem with Sock.lua library

Post by SkippyDip »

Okay, thank you so much for the help.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 56 guests