astrophoenix (zojas) wrote,
astrophoenix
zojas

  • Mood:

how to look up you local machine's external IP address (not 127.0.0.1)

I needed to write some code to find out my local machine's IP address. I wanted to tell another machine my IP address so that other machine could open a socket connection back to my machine. A little googling turned up some sample code which works on both Linux and Mac OS X.

Also I fiddled around with that code and condensed it down a bit.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment