ns_locationproc - Register custom location handler
This command installs a custom script which will return location string for the current connection, as returned by ns_conn location. Usually, a location looks like http://localhost/. ns_locationproc registers the handler for the current server. Therefore, the command cannot be used in the configuration script (no current server, defining the setup of all servers), but in the module files.
script Tcl script which result will be used to return the location string.
namespace eval nstest { ns_locationproc ::nstest::location ad_proc ::nstest::location {args} { set location [ns_conn protocol]://[ns_set iget [ns_conn headers] host] ns_log notice "LOCATION-PROC args <$args> - location <$location>" return $location } ns_log notice "SOURCING location-procs.tcl <[ns_info server]>" }