PLT Web Server Embedding Interface

To use the Web server inside another PLT-Scheme program, require the Web server module:

(require (lib "web-server.ss" "web-server"))
This provides one main function:
serve : [nat] [(str -> host)] [nat] -> (-> void)
(define (serve port virtual-hosts max-waiting) ...)
It starts the server, where port specifies an alternate port for the server to listen on besides 80 and max-waiting lets the caller specify a maximum number of clients that can wait for a TCP connection other than the default of 40. The virtual-hosts function maps host names, which may or may not include a colon followed by a port number, to a host structure. (See configuration.ss for examples of host structures, and see configuration-structures.ss for the data definition.) The result of invoking serve is a thunk that shuts down the server.

Powered by