2021-02-05

(sph scgi)

scgi interface. a server that accepts scgi requests and calls a custom procedure to handle them.

part of sph-lib

library description

http://python.ca/scgi/protocol.txt

module name

(sph scgi)

exported bindings

procedure: scgi-default-address ->
procedure: scgi-handle-requests handle-request #:socket #:address #:port #:parallelism #:exception-key #:server-listen #:server-socket ->
procedure:{list:header:((string . string) ...) port:client -> any} _ ... -> unspecified
optional keyword arguments
#:address string
#:port integer
#:parallelism integer
#:server-listen procedure
#:server-socket procedure
#:socket socket-object
start listening on a socket and call handle-request for each new connection.
the socket protocol-family depends on the address: if it starts with a slash a local unix socket is used, if it contains colons then ip6, otherwise ip4.
if a socket is not given, a local unix socket is created. default port for tcp sockets is 6500.
server-listen and server-socket can be specified to use alternative server implementations, for example (sph server fibers)
procedure: scgi-read-header port cont ->
socket procedure:{list:header -> any} -> any
variable: sph-scgi-description