I've written (for internal use) an HTTP daemon in Pike, using roughly the following featureset: - Mainly meant to run (custom) pike modules processing requests. - Also serves static content (through a simple config file). - Supports multiple virtual servers, with multiple mountpoints each. - Supports database connection pools. - Supports integrated memory caching. - Uses the Shuffler for all network I/O. - Supports websockets. - Gzips output automatically. - Uses statically precompiled .gz files if available and new enough. - It has been fondly baptised as a "Spike" daemon. - It integrates well with an nginx reverse proxy (and thus I did not add SSL support so far), which then adds HTTP/2 and SSL support. - It only runs on Pike 8.1, not Pike 8.0 (mostly because of the broken Shuffler in 8.0). - The whole source is about 15 KB (5 KB when gzipped).
If there is interest, I'll clean up the code a bit more, and make it available via a git repo somehwere.
On Mon, May 25, 2020 at 1:50 AM Stephen R. van den Berg srb@cuci.nl wrote:
I've written (for internal use) an HTTP daemon in Pike, using roughly the following featureset:
- Mainly meant to run (custom) pike modules processing requests.
- Also serves static content (through a simple config file).
- Supports multiple virtual servers, with multiple mountpoints each.
- Supports database connection pools.
- Supports integrated memory caching.
- Uses the Shuffler for all network I/O.
- Supports websockets.
- Gzips output automatically.
- Uses statically precompiled .gz files if available and new enough.
- It has been fondly baptised as a "Spike" daemon.
- It integrates well with an nginx reverse proxy (and thus I did not add SSL support so far), which then adds HTTP/2 and SSL support.
- It only runs on Pike 8.1, not Pike 8.0 (mostly because of the broken Shuffler in 8.0).
- The whole source is about 15 KB (5 KB when gzipped).
If there is interest, I'll clean up the code a bit more, and make it available via a git repo somehwere.
Possible interest. I currently have an integrated web server in my Twitch bot, and some of the features you mention could be of use. Would possibly be useful to incorporate Markdown into this, maybe with caching (which I don't currently have).
ChrisA
Chris Angelico wrote:
I've written (for internal use) an HTTP daemon in Pike, using roughly the following featureset:
If there is interest, I'll clean up the code a bit more, and make it available via a git repo somehwere.
Well, I put something preliminary up. Take a look, and let me know if it could be useful. Suggestions are welcome.
git clone git://devel2.cuci.nl/spike
should get you a fresh tree.
The docs obviously are very limited at the moment. I included a samplesetup.
Possible interest. I currently have an integrated web server in my Twitch bot, and some of the features you mention could be of use. Would possibly be useful to incorporate Markdown into this, maybe with caching (which I don't currently have).
Instead of Markdown, I use Remixml (native javascript, clientside templates).
Stephen R. van den Berg wrote:
git clone git://devel2.cuci.nl/spike
It is production ready.
Rough featurelist: - Meaningful error messages on compiled modules. - Smart auto-recompilation of modules (mtime based). - Auto-fallback to last-known-good modules on compilation failure. - Two classes for module development: Spike.Base and Spike.Site + Spike.Base implements a log() and listenport() primitive. + Spike.Site adds filesystems, databasepools and a configuration system per site. - Live configuration reload through SIGHUP (no downtime). - Integrated HTTP and WebSocket dispatch engine. - Transparent proxy support. - Auto-gzip compression on both static and dynamic content. - Integrated and configurable logging mechanism to syslog. - Completely Shuffler-ised (maximal offloading of communication overhead to pure C and the kernel). - Less filling: 29KB of source code (single file).
pike-devel@lists.lysator.liu.se