OH4mono

Files in pisces/ of tip
Login

Files in directory /pisces from the latest check-in


pisces

pisces

pisces is a safe, fast, and simple HTTP server for static sites written in C.

Usage

usage: pisces PORT WEBDIR [-logfile FILEPATH] [-ssl]

pisces is a safe, fast, and simple web server based on nweb and althttpd.
It only serves files and pages with pre-defined extensions and only from
the named directory or its subdirectories. If a logfile name is provided
it should be relative to WEBDIR. If -ssl is specified it will upgrade
HTTP connections to HTTPS when requested.

Example: pisces 8181 /home/webdir -logfile logs/pisces.log &

Disallowed directories: / /etc /bin /lib /tmp /usr /dev /sbin

Development

Cloning

To clone this monorepo using fossil run:

$ fossil clone https://mono.oh4.co mono.fossil

Building

To build pisces and its associated test client run:

$ make

Testing

Testing is primarily done using the test client which is able to send arbitrary strings of data to the pisces server. You may need to edit the src/client.c file to match your test server IP address and port number.

To test you first need to run a a pisces server, something like the following:

$ ./pisces 8081 .. &

You can then run tests against this server using the client as follows:

$ make test