Web Server: PLT HTTP Server

1`` | Running the Web Server
2`` | Scheme Servlets
3`` | Web Language Servlets
4`` | Configuration
5`` | Dispatchers
6`` | Web Config Unit
7`` | Web Server Unit
8`` | Continuation Managers
9`` | Internal
10`` | Troubleshooting
11`` | Acknowledgements
| Index

On this page:

7.1`` Signature
web-server^
serve
serve-ports
7.2`` Unit
web-server@

Version: 4.0.2
contents index
← prev up next →

### 7`` Web Server Unit

The Web Server offers a unit-based approach to running the server.

#### 7.1`` Signature

(require web-server/web-server-sig)

web-server^ : signature

> (serve) → (-> void)

> Runs the server and returns a procedure that shuts down the server.

> (serve-ports ip op) → void
> ip : input-port?
> op : output-port?

> Serves a single connection represented by the ports ip and op.

#### 7.2`` Unit

(require web-server/web-server-unit)

web-server@ :

(unit/c (web-config^ tcp^)
(web-server^))

Uses the web-config^ to construct a dispatcher? function that sets up one virtual host dispatcher, for each virtual host in the web-config^, that sequences the following operations:

- 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.

- Execute servlets under the "/servlets/" URL in the given servlet root directory.

- Serves files under the "/" URL in the given htdocs directory.

Using this dispatcher?, it loads a dispatching server that provides serve and serve-ports functions that operate as expected.

contents index
← prev up next →