Jump to content

[SOLVED] Sockets binding and accessing problem


AbydosGater

Recommended Posts

Hi, I am running apache and php on my computer with a static ip of 192.168.1.136 but todays ip is http://86.42.77.153/ so its running on that. and everything works there fine. But if i open the PHP binary and run a script that binds a socket to 192.168.1.136 it works fine and i can connect with telnet. But other people cannot connect. So i thought if http is running 86.42.77.153 i could bind the socket to 86.42.77.153. But when i try that i get my "or die("Cannot Bind Socket");".

Does anyone know what i bind to so that outside users can connect to my socket?

 

Andy

Try binding to 0.0.0.0

 

192.168.1.136 is a LOCAL Ip Address.  Computer's that are accessing your server via that IP, will be able to get in. Others, will not.

Why its not binding to 86.42.77.153 I'm not sure, but try for 0.0.0.0.

 

Also, the problem could be that something else is running on that port for the outside IP, and that could be your binding problem.

Ok I tried binding to 0.0.0.0 and the script ran and it awaited the connections.

But i got a friend to try to connect to either:

telnet://192.168.1.136:1234

 

OR

 

telnet://86.42.77.153:1234

(1234) being the port(DUH your not stupid sorry)

 

But neither of them are connecting for him. I can connect via the 192.168.1.136 but noone else.

Anyone know how i can get it so that outside users can connect.

I know the ports are forwarding and everything because http://86.42.77.153 works. But the sockets are not working :(

Ok firstly, Yes there is a router, and no i havnt forwarded the ports?!? I know how to do that but what settings do i use for it? Any online tutorials ill check portforward.com but i think they only have for certain programs not specific things.

 

And no i dont have a firewall.

 

Andy

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.