Re: LuaSocket: find out current IP address
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: LuaSocket: find out current IP address
- From: Enrico Colombini <erix@...>
- Date: 2010年4月11日 14:56:35 +0200
Andreas Falkenhahn wrote:
I'm new to LuaSocket so please bear with me if the next question is
all too obvious :) All I want to do is find out my current IP and host name
using LuaSocket. I tried to use getsockname() but this seems to return
the IP of my router (192.168.0.1) instead of my real IP. How do I retrieve
my real IP using LuaSocket?
Your PC does not know the address your provider gave to your router, so
(as far as I know) LuaSocket cannot easily get it directly.
Yuo can call your router's web/text interface or use a site such as this
one (randomly found with google): http://www.ip-adress.com/
You can read the page and extract the address.
Enrico