This is the s-http-server Reference Manual, version 1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:38:18 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
s-http-server
S-HTTP-SERVER is a small standalone Common Lisp HTTP Server
Sven Van Caekenberghe <svc@mac.com>
Sven Van Caekenberghe <svc@mac.com>
Lesser Lisp General Public License (LLGPL)
S-HTTP-SERVER is a small standalone Common Lisp HTTP Server
1
s-utils
(system).
s-sysdeps
(system).
s-base64
(system).
puri
(system).
salza2
(system).
src
(module).
Modules are listed depth-first from the system components tree.
s-http-server/src
s-http-server
(system).
package.lisp
(file).
globals.lisp
(file).
http-server.lisp
(file).
handlers.lisp
(file).
tools.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
s-http-server/s-http-server.asd
s-http-server/src/package.lisp
s-http-server/src/globals.lisp
s-http-server/src/http-server.lisp
s-http-server/src/handlers.lisp
s-http-server/src/tools.lisp
s-http-server/src/globals.lisp
package.lisp
(file).
src
(module).
*favicon*
(special variable).
*http-server-identification*
(special variable).
*http-server-port*
(special variable).
*last-http-request*
(special variable).
+enable-gzip-compression+
(special variable).
*doctype-html-401-strict*
(special variable).
*doctype-html-401-transitional*
(special variable).
*mime-type-suffix-map*
(special variable).
+access-log-format+
(special variable).
+allowed-connection-keepalive-age+
(special variable).
+allowed-http-methods+
(special variable).
+allowed-keepalive-connections+
(special variable).
+basic-mime-type-suffix-map+
(special variable).
+common-log-timestamp-format+
(special variable).
+common-request-headers+
(special variable).
+compressible-mime-types+
(special variable).
+known-mime.type-locations+
(special variable).
+period-check-interval+
(special variable).
s-http-server/src/http-server.lisp
package.lisp
(file).
globals.lisp
(file).
src
(module).
find-handler
(generic function).
get-access-log-stream
(reader method).
(setf get-access-log-stream)
(writer method).
get-boot-time
(reader method).
(setf get-boot-time)
(writer method).
get-contexts
(reader method).
(setf get-contexts)
(writer method).
get-debug-mode
(reader method).
(setf get-debug-mode)
(writer method).
get-full-path
(generic function).
get-headers
(reader method).
(setf get-headers)
(writer method).
get-http-connection
(reader method).
(setf get-http-connection)
(writer method).
get-http-connections
(reader method).
(setf get-http-connections)
(writer method).
get-http-server
(reader method).
(setf get-http-server)
(writer method).
get-http-version
(reader method).
(setf get-http-version)
(writer method).
get-keep-alive
(reader method).
(setf get-keep-alive)
(writer method).
get-line-buffer
(reader method).
(setf get-line-buffer)
(writer method).
get-log-stream
(reader method).
(setf get-log-stream)
(writer method).
get-method
(reader method).
(setf get-method)
(writer method).
get-name
(reader method).
(setf get-name)
(writer method).
get-path
(generic function).
get-port
(reader method).
(setf get-port)
(writer method).
get-server-process
(reader method).
(setf get-server-process)
(writer method).
get-uri
(reader method).
(setf get-uri)
(writer method).
get-user
(reader method).
(setf get-user)
(writer method).
handle-http-server-connection
(generic function).
http-request
(class).
logm
(generic function).
print-object
(method).
print-object
(method).
print-object
(method).
register-context-handler
(generic function).
s-http-server
(class).
standard-http-html-error-response
(function).
standard-http-html-message-response
(function).
standard-http-response-headers
(function).
start-server
(generic function).
stop-server
(generic function).
unregister-context-handler
(generic function).
write-http-response-headers
(function).
write-http-response-line
(function).
write-http-response-status-line
(function).
bogus-http-request-method
(condition).
bogus-http-request-uri
(condition).
cleanup-connections
(method).
cleanup-dead-connections
(method).
cleanup-excess-alive-connections
(method).
cleanup-old-connections
(method).
do-periodic-check
(method).
escape
(function).
flush-log-streams
(method).
format-http-response-line
(function).
get-age
(method).
get-id
(reader method).
(setf get-id)
(writer method).
get-last-periodic-check
(reader method).
(setf get-last-periodic-check)
(writer method).
get-log-lock
(reader method).
(setf get-log-lock)
(writer method).
get-process
(reader method).
(setf get-process)
(writer method).
get-request-count
(reader method).
(setf get-request-count)
(writer method).
get-state
(reader method).
(setf get-state)
(writer method).
get-stream
(reader method).
(setf get-stream)
(writer method).
get-timestamp
(reader method).
(setf get-timestamp)
(writer method).
handle-new-http-server-connection
(method).
handle-one-http-request-response
(method).
header-field-name->keyword
(function).
header-field-value->string
(function).
http-connection
(class).
http-request-error
(condition).
kill-connection
(method).
log-access
(method).
missing-http-request-line
(condition).
parse-http-date
(function).
parse-http-request
(function).
parse-http-request-headers
(function).
parse-http-request-line
(function).
read-crlf-line
(function).
response-date
(function).
s-http-server/src/handlers.lisp
package.lisp
(file).
http-server.lisp
(file).
globals.lisp
(file).
src
(module).
accepts-gzip-encoding-p
(function).
compressible-mime-type-p
(function).
favicon-handler
(function).
get-byte-buffer
(method).
get-gzip-compressor
(method).
gzip-compress
(function).
redirect-handler
(function).
request-header-value
(function).
s-http-server-handler
(function).
static-resource-handler
(function).
wrap-with-basic-authentication
(function).
authorized-p
(function).
basic-authentication-required-http-response
(function).
compute-real-resource-pathname
(function).
decode-basic-authorization
(function).
dw-bench
(function).
echo-debug-handler
(function).
hello-world
(function).
host-static-bytes
(function).
host-static-resource
(function).
make-real-resource-pathname
(function).
mime-type-for-pathname
(function).
mime-type-suffix-map
(function).
ps-handler
(function).
random-handler
(function).
s-http-server/src/tools.lisp
package.lisp
(file).
http-server.lisp
(file).
handlers.lisp
(file).
globals.lisp
(file).
src
(module).
configure-default-handlers
(function).
make-s-http-server
(function).
ps
(function).
Packages are listed by definition order.
s-http-server
S-HTTP-SERVER is a minial standalone Common Lisp HTTP Server
common-lisp
.
*favicon*
(special variable).
*http-server-identification*
(special variable).
*http-server-port*
(special variable).
*last-http-request*
(special variable).
+enable-gzip-compression+
(special variable).
accepts-gzip-encoding-p
(function).
compressible-mime-type-p
(function).
configure-default-handlers
(function).
favicon-handler
(function).
find-handler
(generic function).
get-access-log-stream
(generic reader).
(setf get-access-log-stream)
(generic writer).
get-boot-time
(generic reader).
(setf get-boot-time)
(generic writer).
get-byte-buffer
(generic function).
get-contexts
(generic reader).
(setf get-contexts)
(generic writer).
get-debug-mode
(generic reader).
(setf get-debug-mode)
(generic writer).
get-full-path
(generic function).
get-gzip-compressor
(generic function).
get-headers
(generic reader).
(setf get-headers)
(generic writer).
get-http-connection
(generic reader).
(setf get-http-connection)
(generic writer).
get-http-connections
(generic reader).
(setf get-http-connections)
(generic writer).
get-http-server
(generic reader).
(setf get-http-server)
(generic writer).
get-http-version
(generic reader).
(setf get-http-version)
(generic writer).
get-keep-alive
(generic reader).
(setf get-keep-alive)
(generic writer).
get-line-buffer
(generic reader).
(setf get-line-buffer)
(generic writer).
get-log-stream
(generic reader).
(setf get-log-stream)
(generic writer).
get-method
(generic reader).
(setf get-method)
(generic writer).
get-name
(generic reader).
(setf get-name)
(generic writer).
get-path
(generic function).
get-port
(generic reader).
(setf get-port)
(generic writer).
get-server-process
(generic reader).
(setf get-server-process)
(generic writer).
get-uri
(generic reader).
(setf get-uri)
(generic writer).
get-user
(generic reader).
(setf get-user)
(generic writer).
gzip-compress
(function).
handle-http-server-connection
(generic function).
http-request
(class).
logm
(generic function).
make-s-http-server
(function).
ps
(function).
redirect-handler
(function).
register-context-handler
(generic function).
request-header-value
(function).
s-http-server
(class).
s-http-server-handler
(function).
standard-http-html-error-response
(function).
standard-http-html-message-response
(function).
standard-http-response-headers
(function).
start-server
(generic function).
static-resource-handler
(function).
stop-server
(generic function).
unregister-context-handler
(generic function).
wrap-with-basic-authentication
(function).
write-http-response-headers
(function).
write-http-response-line
(function).
write-http-response-status-line
(function).
*doctype-html-401-strict*
(special variable).
*doctype-html-401-transitional*
(special variable).
*mime-type-suffix-map*
(special variable).
+access-log-format+
(special variable).
+allowed-connection-keepalive-age+
(special variable).
+allowed-http-methods+
(special variable).
+allowed-keepalive-connections+
(special variable).
+basic-mime-type-suffix-map+
(special variable).
+common-log-timestamp-format+
(special variable).
+common-request-headers+
(special variable).
+compressible-mime-types+
(special variable).
+known-mime.type-locations+
(special variable).
+period-check-interval+
(special variable).
authorized-p
(function).
basic-authentication-required-http-response
(function).
bogus-http-request-method
(condition).
bogus-http-request-uri
(condition).
cleanup-connections
(generic function).
cleanup-dead-connections
(generic function).
cleanup-excess-alive-connections
(generic function).
cleanup-old-connections
(generic function).
compute-real-resource-pathname
(function).
decode-basic-authorization
(function).
do-periodic-check
(generic function).
dw-bench
(function).
echo-debug-handler
(function).
escape
(function).
flush-log-streams
(generic function).
format-http-response-line
(function).
get-age
(generic function).
get-id
(generic reader).
(setf get-id)
(generic writer).
get-last-periodic-check
(generic reader).
(setf get-last-periodic-check)
(generic writer).
get-log-lock
(generic reader).
(setf get-log-lock)
(generic writer).
get-process
(generic reader).
(setf get-process)
(generic writer).
get-request-count
(generic reader).
(setf get-request-count)
(generic writer).
get-state
(generic reader).
(setf get-state)
(generic writer).
get-stream
(generic reader).
(setf get-stream)
(generic writer).
get-timestamp
(generic reader).
(setf get-timestamp)
(generic writer).
handle-new-http-server-connection
(generic function).
handle-one-http-request-response
(generic function).
header-field-name->keyword
(function).
header-field-value->string
(function).
hello-world
(function).
host-static-bytes
(function).
host-static-resource
(function).
http-connection
(class).
http-request-error
(condition).
kill-connection
(generic function).
log-access
(generic function).
make-real-resource-pathname
(function).
mime-type-for-pathname
(function).
mime-type-suffix-map
(function).
missing-http-request-line
(condition).
parse-http-date
(function).
parse-http-request
(function).
parse-http-request-headers
(function).
parse-http-request-line
(function).
ps-handler
(function).
random-handler
(function).
read-crlf-line
(function).
response-date
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
If not nil, the pathname to a favicon.ico or a (unsigned-byte 8) array representing a favicon
Identification string sent as value of the ’Server’ HTTP Response Header
Default port used when creating a new S-HTTP-SERVER
The last HTTP-REQUEST object handled by S-HTTP-SERVER
Use Salza2 to GZIP compress certain mime types
Return T when http-request accepts gzip content encoding
Return T when mime-type is compressible using gzip
Setup a set of default handlers to a server
Handle that annoying favicon.ico request in a more elegant way
Compress input stream or function in using gzip, returning (values data-chunks data-size)
Create a new object representing an S-HTTP-SERVER
Show the state of all http connections known to the server
This handler immediately redirects to another URL
Get the value of a named header of http-request
The builtin S-HTTP-SERVER testing/debugging handler returning a simple status/echo/snoop page
Generate and write a standard HTML error as HTTP Response using code, reason and extra
Generate and write a standard HTML message as HTTP Response using title, message, status and string
Generate the standard headers alist given context-type and context-length, managing old-style Keep-Alive
Host static resources from a document root
Creates and returns a new handler that wraps handler-function and argument with basic authentication. Authenticator is either a dotted alist of usernames and passwords or a function accepting (username . password). Realm is for use in the WWW-Authenticate header response.
Write the headers alist as HTTP Response Headers to stream
Write string to stream, ending with the HTTP end of line convention (CR+LF)
Write an HTTP Response Status line to stream, using status-code string and http-version
Given http-request select a handler from server
s-http-server
) http-request) ¶Get the current stream used by this S-HTTP-SERVER for access logging, nil means no logging
s-http-server
)) ¶automatically generated reader method
Set the stream this S-HTTP-SERVER uses for access logging, nil means no logging
s-http-server
)) ¶automatically generated writer method
Get the universal time when this S-HTTP-SERVER was last started, nil if not running
s-http-server
)) ¶automatically generated reader method
s-http-server
)) ¶automatically generated writer method
http-connection
)) ¶Get the current list of context bindings used by this S-HTTP-SERVER
s-http-server
)) ¶automatically generated reader method
s-http-server
)) ¶automatically generated writer method
Get the current mode of debugging of this S-HTTP-SERVER, t is on, nil is off
s-http-server
)) ¶automatically generated reader method
Set the current debugging mode of this S-HTTP-SERVER, t is on, nil is off
s-http-server
)) ¶automatically generated writer method
Get the full path of this HTTP request (including the query)
http-request
)) ¶http-connection
)) ¶Get the dotted alist (:keyword . ’value’) of request headers of this HTTP request
http-request
)) ¶automatically generated reader method
http-request
)) ¶automatically generated writer method
The HTTP connection this request belongs to, nil if not set
http-request
)) ¶automatically generated reader method
http-request
)) ¶automatically generated writer method
s-http-server
)) ¶automatically generated reader method
s-http-server
)) ¶automatically generated writer method
Get the HTTP server this object belongs to, nil if not set
http-connection
)) ¶automatically generated reader method
http-connection
)) ¶automatically generated writer method
Get the HTTP version string of this HTTP request
http-request
)) ¶automatically generated reader method
http-request
)) ¶automatically generated writer method
Is this a keep-alive request (either 1.0 or 1.1)
http-request
)) ¶automatically generated reader method
http-request
)) ¶automatically generated writer method
http-connection
)) ¶automatically generated reader method
http-connection
)) ¶automatically generated writer method
Get the current stream used by this S-HTTP-SERVER for general logging, nil means no logging
s-http-server
)) ¶automatically generated reader method
Set the stream this S-HTTP-SERVER uses for general logging, nil means no logging
s-http-server
)) ¶automatically generated writer method
Get the method (keyword :get :put :post :delete ..) of this HTTP request
http-request
)) ¶automatically generated reader method
http-request
)) ¶automatically generated writer method
Get the current name of this S-HTTP-SERVER
s-http-server
)) ¶automatically generated reader method
name
.
Set the name of this S-HTTP-SERVER
s-http-server
)) ¶automatically generated writer method
name
.
Get the path of this HTTP request
http-request
)) ¶Get the TCP port used by this S-HTTP-SERVER
s-http-server
)) ¶automatically generated reader method
port
.
Set the port of this S-HTTP-SERVER (before starting the server)
s-http-server
)) ¶automatically generated writer method
port
.
Get the current server process used by this S-HTTP-SERVER, nil if not running
s-http-server
)) ¶automatically generated reader method
s-http-server
)) ¶automatically generated writer method
Get the URI object of this HTTP request
http-request
)) ¶automatically generated reader method
uri
.
http-request
)) ¶automatically generated writer method
uri
.
http-request
)) ¶automatically generated reader method
user
.
http-request
)) ¶automatically generated writer method
user
.
Handle connection requests
s-http-server
) http-connection) ¶Log a formatted message
s-http-server
) kind format-string &rest args) ¶Configure server so that every request starting with context-prefix is sent to handler-function
s-http-server
) context-prefix handler-function &key arguments at-end-p do-not-replace-p) ¶Start the server
s-http-server
)) ¶Stop the server
s-http-server
)) ¶Remove any configuration of server for context-prefix
s-http-server
) context-prefix &key only-first-p only-last-p) ¶http-request
) stream) ¶s-http-server
) stream) ¶http-connection
) output-stream) ¶The object representing an HTTP request as being handled by the S-HTTP-SERVER
common-lisp
.
:get
:method
(puri:parse-uri "/")
:uri
"http/1.1"
:http-version
(quote nil)
:headers
(s-sysdeps:multiprocessing-capable-p)
:keep-alive
The object representing a minimal standalone HTTP Server
cleanup-connections
.
cleanup-dead-connections
.
cleanup-excess-alive-connections
.
cleanup-old-connections
.
do-periodic-check
.
find-handler
.
flush-log-streams
.
(setf get-access-log-stream)
.
get-access-log-stream
.
(setf get-boot-time)
.
get-boot-time
.
(setf get-contexts)
.
get-contexts
.
(setf get-debug-mode)
.
get-debug-mode
.
(setf get-http-connections)
.
get-http-connections
.
(setf get-last-periodic-check)
.
get-last-periodic-check
.
(setf get-log-lock)
.
get-log-lock
.
(setf get-log-stream)
.
get-log-stream
.
(setf get-name)
.
get-name
.
(setf get-port)
.
get-port
.
(setf get-server-process)
.
get-server-process
.
handle-http-server-connection
.
handle-new-http-server-connection
.
handle-one-http-request-response
.
log-access
.
logm
.
print-object
.
register-context-handler
.
start-server
.
stop-server
.
unregister-context-handler
.
s-http-server:*http-server-port*
:port
"s-http-server"
:name
t
:debug-mode
:log-stream
:access-log-stream
(s-sysdeps:make-process-lock "s-http-server-log-lock")
(get-universal-time)
:contexts
Hashtable mapping suffixes to mime-types, computed at run-time
Either :common-log-format or :extended-common-log-format
Number of seconds a kept alive connection is allowed to be inactive (Apache default)
The HTTP methods that we allow in the request line
Maximum number of simulataneous kept alive connections (hard resoure limit)
Fallback for when no mime-type info can be loaded from a known location
The list of mime-types that can/should be gzip compressed
Places to search for a system level mime-type to suffix map
Do some periodic checks every 5 seconds
Check whether a basic-authorization is authorized by authenticator
Decode the Base64 encoding of username:password returning (username . password)
An echoing testing/debugging handler returning a simple text/plain status/echo/snoop page
Return (values t <response-code> <size>) handling condition GET as well
Return (values t <response-code> <size>) handling conditional GET as well
Return the CL universal-time represented in string using GMT HTTP Date format, or nil on error
Show the state of all http connections known to the server
Return a random hex string of a specified size
Read a CRLF termintated line from a character input stream into line-buffer. Return length excluding CRLF.
Generate a GMT HTTP Response Date
s-http-server
) &key filter selector threshold) ¶s-http-server
)) ¶s-http-server
)) ¶s-http-server
)) ¶s-http-server
)) ¶s-http-server
)) ¶http-connection
)) ¶http-connection
)) ¶automatically generated reader method
id
.
http-connection
)) ¶automatically generated writer method
id
.
s-http-server
)) ¶automatically generated reader method
s-http-server
)) ¶automatically generated writer method
s-http-server
)) ¶automatically generated reader method
s-http-server
)) ¶automatically generated writer method
http-connection
)) ¶automatically generated reader method
http-connection
)) ¶automatically generated writer method
http-connection
)) ¶automatically generated reader method
http-connection
)) ¶automatically generated writer method
http-connection
)) ¶automatically generated reader method
http-connection
)) ¶automatically generated writer method
http-connection
)) ¶automatically generated reader method
http-connection
)) ¶automatically generated writer method
http-connection
)) ¶automatically generated reader method
http-connection
)) ¶automatically generated writer method
s-http-server
) socket-stream connection-id) ¶s-http-server
) http-connection) ¶http-connection
)) ¶s-http-server
) http-connection http-request response bytes) ¶error
.
The object representing a kept-alive HTTP connection and handling process
get-age
.
get-byte-buffer
.
get-gzip-compressor
.
(setf get-http-server)
.
get-http-server
.
(setf get-id)
.
get-id
.
(setf get-line-buffer)
.
get-line-buffer
.
(setf get-process)
.
get-process
.
(setf get-request-count)
.
get-request-count
.
(setf get-state)
.
get-state
.
(setf get-stream)
.
get-stream
.
(setf get-timestamp)
.
get-timestamp
.
kill-connection
.
print-object
.
-1
:id
(member :new :active :dead)
:new
common-lisp
.
:stream
:process
(make-array 256 :element-type (quote character) :adjustable t)
0
(get-universal-time)
:server
Jump to: | (
A B C D E F G H K L M P R S U W |
---|
Jump to: | (
A B C D E F G H K L M P R S U W |
---|
Jump to: | *
+
A B C D G H I K L M N P R S T U |
---|
Jump to: | *
+
A B C D G H I K L M N P R S T U |
---|
Jump to: | B C F G H M P S T |
---|
Jump to: | B C F G H M P S T |
---|