Page 2 of 2

Re: enet cannot create any server

Posted: Sat Jun 15, 2019 8:06 am
by Karai17
I have never in my life been unable to connect to a server i bound to 127.0.0.1 or localhost.

Re: enet cannot create any server

Posted: Sat Jun 15, 2019 8:41 am
by pgimeno
Weird. Maybe you have a route of some sort to 127.0.0.1 (which sounds like a security risk). If I run

Code: Select all

nc.openbsd -l 127.0.0.1 7766
on one computer and try to connect from another with

Code: Select all

nc.openbsd -v <ip> 7766
it doesn't connect. However if I use this in the first machine instead:

Code: Select all

nc.openbsd -l 0.0.0.0 7766
it connects perfectly.

Edit: See also https://stackoverflow.com/questions/240 ... t#24057311

Edit2: In https://security.stackexchange.com/ques ... onnections it says that for IPv6 the situation may be different, in that it might be possible to send spoofed IP packets to ::1.

Re: enet cannot create any server

Posted: Sat Jun 15, 2019 9:12 am
by Karai17
might just be a unix thing.

Re: enet cannot create any server

Posted: Sat Jun 15, 2019 4:41 pm
by PGUp
my ipv4 adress suddenly changed itself, i ran ipconfig command and it was definitely changed.

it was

Ethernet adapter Ethernet:
IPv4 Address. . . . . . . . . . . : 192.168.100.7(Preferred)

to

Ethernet adapter Ethernet:
IPv4 Address. . . . . . . . . . . : 192.168.100.3(Preferred)

i created server on that ip and everything can connect through LAN smoothly, that's all I care about. Thanks for all the help!

Re: enet cannot create any server

Posted: Sun Jun 16, 2019 1:57 pm
by dusoft
PGUp wrote: Thu Jun 13, 2019 4:10 am
dusoft wrote: Wed Jun 12, 2019 8:54 pm
PGUp wrote: Wed Jun 12, 2019 5:25 pm

the ip of 127.0.0.1 is the same as localhost, I'm not planning to use a localhost server, I want to connect multiple devices together.
Yes, but you should be creating host at the local address (localhost) and only then use the local 192.168.x.x (or WAN external) address from the other devices.
a localhost can only be created and connected through the same machine, other devices wont connect to a localhost, that's why it is called localhost. I want other devices to connect, not only mine
As Karai mentioned before, other devices (guests) don't care about your localhost, they would use the external address accessing your server (host).