This library finds the public address of the running server. This can be used to construct URLs that are visible from anywhere on the internet. This module was introduced to deal with OpenID, where a request is redirected to the OpenID server, which in turn redirects to our server (see http_openid.pl).
The address is established from the settings
http:public_port if provided. Otherwise it is deduced from the request.
- http_public_url(+Request, -URL) is det
- True when URL is an absolute URL for the current request. Typically, the login page should redirect to this URL to avoid losing the session.
- http_public_host_url(+Request, -URL) is det
- True when URL is the public URL at which this server can be contacted. This value is not easy to obtain. See http_public_host/4 for the hardest part: find the host and port.
- http_public_host(?Request, -Hostname, -Port, +Options) is det
- Current global host and port of the HTTP server. This is the
basis to form absolute address, which we need for redirection
based interaction such as the OpenID protocol. Options are:
false), try to replace a local hostname by a world-wide accessible name.
This predicate performs the following steps to find the host and port:
- http_current_host(?Request, -Hostname, -Port, +Options) is det