HttpServer

For an HTTP server which makes use of modern Emacs network process handling see Web Server which requires Emacs 24.3 or greater but has no other dependencies. Web-server supports the full range of HTTP GET and POST requests, and web sockets. The info manual including usage examples is available online at manual.


Emacs 23 supports server sockets and asynchronous server sockets. Elnode is an asychronous http server in elisp by NicFerrier.

The async approach has several benefits:


Below are two older approaches.


httpd.el was originally written by EricMarsden. See EmacsHttpd for the original.

JohnWiegley posted version 1.0 as:

2003-11-14 (1.0): This customized version of httpd.el is always current, plus whatever other modifications emacs-wiki.el or httpd-serve need.

httpd.el is an HTTP server embedded in the Emacs. It supports GET and HEAD requests for static and dynamic content. (supporting POST should be easy by stealing code from CommonGatewayInterface above).

Note the following if you use Emacs version 21.4 or lower: Since Emacs doesn’t support server sockets, you need to cheat a little and run it from a service such as tcpserver or inetd. You can get better performance by running a proxy server which forwards requests to a persistent emacs instance using gnuserv; see the commentary for details. Version 0.4, 2001-05-17 under GNU GPL.


phase.el is an HTTP server by AlexShinn under development, with cgi functionality and the ability to parse emacs lisp embedded in html documents.


The first one above does not work for emacs23, and the second one redirects to a blank page.

Here’s one that I am using now - http://nullprogram.com/blog/2009/05/17/


CommonGatewayInterface EricMarsden EmacsHttpd