How do I find my own IP address?

Shawn Pearce <>
Thu Jan 22 02:13:09 CET 2004


Joe, given you are just looking in the xauth file, you can change the
code to use the undocumented function you found which returns all
IP addresses on this machine, and then test each in the xauth file.
But connect to the X server using 127.0.0.1 if one of those matched.

In general though you definately should not attempt to connect to
the X server through any of those IP addresses, etc.

I hate systems that use a local IP address in a .Xauthority file.

Joe Armstrong <> wrote:
> On Wed, 21 Jan 2004, Luke Gorrie wrote:
> 
> > Joe Armstrong <> writes:
> > 
> > > I need to know my own IP address
> > 
> > For what purpose? There's no simple answer because you don't
> > necessarily just have one IP address, and there are different ways to
> > find the right IP address for different purposes.
> 
> Because this is sometimes used as a key in the .Xauthority file
> 
> My problem is to write  bomb proof code to open a connection to the local
> X-server - this should try to handle cases where DISPLAY etc is incorrect
> 
> /Joe

-- 
Shawn.

  For good, return good.
  For evil, return justice.



More information about the erlang-questions mailing list