Seite 1 von 1

Sockets

Verfasst: Freitag 14. April 2006, 09:36
von Me
Hi,
First of all, i'm not German so could you please answer me in English?
Here's my problem:
I made a quick easy server and client with sockets, and it works when
the host = "localhost", but tath's only on my computer...
How do i get my server online? So everyone can connect to the server?

Thanks

Verfasst: Freitag 14. April 2006, 10:15
von modelnine
Don't bind the server to "localhost", but to the empty string "", which signifies to bind to every interface your computer has. Now, find out (some way or another, using ipconfig would be one way if you're running Windows, if you're running *nix, you should know how ;-)) the IP address your computer has (on it's external interface), give that to someone, along with your client, and let him replace "localhost" with the corresponding address you found out. After that, you should be set to go. This all assumes there's no NAT or Firewall between you and the client you wants to connect to you. If there is, it depends on your setup how you should/must work around it, and we can't help you.

Next time, please ask on comp.lang.python in usenet (accessible via Google Groups), or on one of the many english Python forums out there. It's not that anybody here has anything against you as a person, but bear in mind that there are quite a lot of german's who don't speak english fluently, and won't have any benefit from neither your nor my post. Additionally, your question is "lost" for other native english speakers (because normally they won't come ask here), and my answer is lost for native english speakers for just the same reason. And that pretty much contradicts what a forum is for. So, please just use the forum that's meant to be used. ;-)

Verfasst: Freitag 14. April 2006, 10:35
von Me
Thanks :D But i've got one more question: I'm running windows, so i can use ipconfig, but... don't i get my ip form the network? So... do i have to give someone with the client the ip address i can find on http://www.whatismyipaddress.com/?

Verfasst: Freitag 14. April 2006, 10:39
von modelnine
If you can't find the adress you get from following the link in the output of "ipconfig", you're using NAT (somewhere between you and the Internet). And, as I said, there's nothing we can easily tell you to do so that you'll be able to accept connections from the outside, as all connections people from the outside do to you will end at your NAT gateway. Basically, you'd need to establish some kind of port-forwarding, but how you configure your router to do that, and if it's possible at all, we can't tell you.

So, I basically guess you're out of luck, or rather, you're on your own. ;-)

Verfasst: Freitag 14. April 2006, 10:45
von Me
Ok :wink: i got a friend and his father know alot about routers and things... :lol: il ask him, but i know how to forward ports in my router so i can try