
http_wrapper.pl -- Server processing of an HTTP requestMost code doesn't need to use this directly; instead use library(http/http_server), which combines this library with the typical HTTP libraries that most servers need.
This library provides the core of the implementation of the HTTP
protocol at the server side and is mainly intended for internal use.
It is used by library(thread_httpd) and library(inet_httpd)
(deprecated).
Still, it provides a few predicates that are occasionally useful for applications:
X-Forwarded-For)
http_wrapper(:Goal, +In, +Out, -Close, +Options) is det
The goal is assumed to write the reply to current_output preceded
by an HTTP header, closed by a blank line. The header must
contain a Content-type: <type> line. It may optionally contain a
line Transfer-encoding: chunked to request chunked encoding.
Options:
http_wrap_spawned(:Goal, +Request, -Close) is det
http_spawned(+ThreadId)
cgi_hook(+Event, +CGI) is det
http_send_header(+Header)
http_current_request(-Request) is semidet
http_peer(+Request, -PeerIP:atom) is semidetFastly-client-ipX-real-ipX-forwarded-for
http_relative_path(+AbsPath, -RelPath) is det