diff --git a/extra/webapps/ip/ip.factor b/extra/webapps/ip/ip.factor new file mode 100644 index 0000000000..7124d4a5c4 --- /dev/null +++ b/extra/webapps/ip/ip.factor @@ -0,0 +1,16 @@ +! Copyright (C) 2008 Doug Coleman. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors furnace.actions http.server.dispatchers +html.forms io.servers.connection namespaces prettyprint ; +IN: webapps.ip + +TUPLE: ip-app < dispatcher ; + +: ( -- action ) + + [ remote-address get host>> "ip" set-value ] >>init + { ip-app "ip" } >>template ; + +: ( -- dispatcher ) + ip-app new-dispatcher + "" add-responder ; diff --git a/extra/webapps/ip/ip.xml b/extra/webapps/ip/ip.xml new file mode 100644 index 0000000000..c8529c27ce --- /dev/null +++ b/extra/webapps/ip/ip.xml @@ -0,0 +1,7 @@ + + + + Your IP address is: + + +