Page 1 of 1

A problem with Sock.lua library

Posted: Thu Oct 10, 2019 7:59 pm
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:

Re: A problem with Sock.lua library

Posted: Thu Oct 10, 2019 11:30 pm
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.

Re: A problem with Sock.lua library

Posted: Fri Oct 11, 2019 9:20 am
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.

Re: A problem with Sock.lua library

Posted: Fri Oct 11, 2019 10:54 am
by SkippyDip
But I wanna make it so people around the world can connect to the server/IP, I don't want to localhost.

Re: A problem with Sock.lua library

Posted: Fri Oct 11, 2019 10:58 am
by pgimeno
Use 0.0.0.0

Re: A problem with Sock.lua library

Posted: Fri Oct 11, 2019 10:59 am
by SkippyDip
Okay, thank you so much for the help.