[luci] To Get Client IP Addr - Lucittpd seems not running in CGI Mode
Patrick Sun
lawipac at gmail.com
Thu Jan 14 12:29:46 CET 2010
Hi all,
Can anyone with a deep understanding of LuCI give me a hint on how
Lucittpd works with LuCI?
Goal:
I try to write a program try to display client's IP addr, MAC
addr through LuCI Web.
Failed Approach 1:
according to my understanding. Cgi program get REMOTE_ADDR
from environment variables...
so os.getenv("REMOTE_ADDR") should have the ip addr...
however, when I write os.getenv("REMOTE_ADDR") into LuCI's
node action function.. it returns nil.
Failed Approach 2:
I tried to use luci.http.getenv("REMOTE_ADDR") it also return
nil, although
luci.http.write seems working properly.
Failed Approach 3:
I tried to use os.getenv in luci-0.8.8/host/www/cgi-bin/luci,
however, it seems never being called.
I deleted luci-0.8.8/host/www/cgi-bin/luci , LuCI still
runs properly with http://localhost:8080/
Possible Findings and Thinkings:
I'm thinking that Lucittpd is quite different from normal httpd. such as
busybox httpd or lighttpd..
It may run luci directly.
maybe lucittpd always think 'http://localhost:8080/luci' as a script to
run.
Which local file does http://localhost:8080/luci maps to ?
unlike http://localhost/cgi-bin -> luci-0.8.8/host/www/cgi-bin/
I cannot find configuration files that tell me where
http://localhost:8080/luci -> maps to ?
the luci-0.8.8/host/www/luci is a dummy directory, even if I remove the
directory,
http://localhost:8080/luci still works with lucittpd.
Regards
Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.subsignal.org/pipermail/luci/attachments/20100114/80e28c3c/attachment.htm
More information about the luci
mailing list