A Web server is a unit with the web-server^ signature. The most common way to construct one is to provide a web-config^ unit to the web-server@ unit. The most common way to construct a web-config^ unit is to use configuration-table->web-config@ to produce one from a configuration table file, such as the one that is shipped with Racket in default-configuration-table-path .
signature
web-server^ :signature
The same as serve from dispatch-server^ . The dispatch-server^ signature is an alias for web-server^ .procedure
( serve-ports ipop)→any
ip:input-port?op:output-port?Asynchronously serves a single connection represented by the ports ip and op.
value
Logs the incoming request with the given format to the given file
Performs HTTP Basic Authentication with the given password file
Allows the "/conf/refresh-passwords" URL to refresh the password file.
Allows the "/conf/collect-garbage" URL to call the garbage collector.
Allows the "/conf/refresh-servlets" URL to refresh the servlets cache.
Executes servlets mapping URLs to the given servlet root directory under htdocs.
Serves files under the "/" URL in the given htdocs directory.
Using this dispatcher/c , it loads a dispatching server that provides serve and serve-ports functions that operate as expected.
Added in version 1.1 of package web-server-lib.
Changed in version 1.6: Use web-config*^ rather than web-config^ .
See compatability note.
value
Changed in version 1.6 of package web-server-lib: Use web-config*^ rather than web-config^ . See compatability note.
signature
web-config*^ :signature
Contains the following identifiers.
Added in version 1.6 of package web-server-lib.
value
A safety limits value specifying the policies to be used while reading and handling requests.value
virtual-hosts :(string? . -> .host? )
Contains the configuration of individual virtual hosts.value
Specifies the port to serve HTTP on.Passed to tcp-listen .Passed to servlets:make through make-default-path->servlet .
signature
web-config^ :signature
NOTE: This signature is deprecated; use web-config*^ , instead.
For backwards compatability, web-config^ extends web-config*^ and uses define-values-for-export to define safety-limits as:#:max-waitingmax-waitingChanged in version 1.6 of package web-server-lib: Deprecated in favor of web-config*^ . See compatability note.
Passed to make-safety-limits .Passed to make-safety-limits as its #:request-read-timeout argument.Changed in version 1.6 of package web-server-lib: Loosened contract for consistency with make-safety-limits .
procedure
path[ #:portport#:listen-iplisten-ip#:make-servlet-namespacemake-servlet-namespace])path:path-string?make-servlet-namespace : make-servlet-namespace/c
procedure
sexpr[ #:web-server-rootweb-server-root#:portport#:listen-iplisten-ip#:make-servlet-namespacemake-servlet-namespace])sexpr:list?web-server-root : path-string?make-servlet-namespace : make-servlet-namespace/c
value
configuration-table-sexpr? :(any . -> .boolean? )
procedure
procedure
( configuration-table->sexpr ctable)
ctable:configuration-table?
(default-host-table,host-table-sexpr?)(virtual-host-table...))
`(host-table(messages(timeouts(file-base-connection-timeout,integer))(paths
procedure
path:path-string?
procedure
( write-configuration-table ctablepath)→void
ctable:configuration-table?path:path-string?
struct
max-waitinginitial-connection-timeoutdefault-hostvirtual-hosts)port:port-number?max-waiting:exact-nonnegative-integer?initial-connection-timeout:natural-number/cdefault-host:host-table?
log-format:symbol?responders:responders?timeouts:timeouts?paths:paths?
struct
servlet-loadingauthenticationservlets-refreshedpasswords-refreshedfile-not-foundprotocolcollect-garbage)
struct
authenticationservlets-refreshedpasswords-refreshedfile-not-foundprotocolcollect-garbage)servlet:string?authentication:string?servlets-refreshed:string?passwords-refreshed:string?file-not-found:string?protocol:string?collect-garbage:string?
default-servlet:number?password:number?servlet-connection:number?file-per-byte:number?file-base:number?
procedure
short-versiontext-filehttp-code:natural-number/cshort-version:string?text-file:string?header:header?
procedure
( servlet-loading-responder urlexn)→response?
url:url?exn:exn?
procedure
( gen-servlet-not-found file)→((url url? ). -> .response? )
file:path-string?
procedure
( servlet-error-responder urlexn)→response?
url:url?exn:exn?
procedure
( gen-servlet-responder file)
file:path-string?
procedure
( gen-servlets-refreshed file)→(-> response? )
file:path-string?
procedure
( gen-passwords-refreshed file)→(-> response? )
file:path-string?
procedure
( gen-authentication-responder file)
file:path-string?
procedure
( gen-protocol-responder file)→((url url? ). -> .response? )
file:path-string?
procedure
( gen-file-not-found-responder file)
file:path-string?
procedure
( gen-collect-garbage-responder file)→(-> response? )
file:path-string?