twt::server_url (public, deprecated)

 twt::server_url

Defined in packages/acs-automated-testing/tcl/tclwebtest-procs.tcl

Deprecated. Invoking this procedure generates a warning.

Get the URL of the server (like ad_url) using the IP number of the server. Is more bulletproof than using the domain name.

Author:
Peter Marklund DEPRECATED: a more reliable api is now available that also allows to override it via parameter.
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) util_current_location util_current_location (public) twt::server_url twt::server_url twt::server_url->ad_log_deprecated twt::server_url->util_current_location

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc twt::server_url
    set ip_address [ns_config ns/server/[ns_info server]/module/nssock Address]

    # If the IP is not configured in the config.tcl we will use the ip of localhost
    if {$ip_address eq ""} {
     set ip_address 127.0.0.1
    }

    regexp {(:[0-9]*)?$} [util_current_location] match port

    if { [info exists port] && $port ne "" } {
        return "http://${ip_address}${port}"
    } else {
        return "http://$ip_address"
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: