useful, but probably has some buglets lingering in rarely exercised
this is a http library, and simple sample http download client.
the library supports both reading & writing requests & responses.
- ssl (using inferno's ssl device)
- can do gzip/deflate negotiation for requests
- supports low-level operations (reading/writing request/response)
as well as high-level operations (pass request, get file descriptor
to read response from (hiding intricacies of ssl, deflate and/or
- supports http 1.0/1.1 and versionless "0.9"
- can request through proxy
get the latest version from:
make sure you have $ROOT set, now "mk install" to compile and install
when building from within inferno, insert SYSHOST=Inferno and ROOT=
in the mk invocations to override the values in the mkconfig.
# licence & author
this code is in the public domain, written by mechiel lukkien,
reachable at email@example.com.
- split some of mhttp.m into an httpclient library, with higher-level
functionality (e.g. following redirects, handling range responses).
rewrite hget to use it.
- lib: don't reinvent url parsing? but use (one of the two?) url
libs in inferno.
- lib: rename it from mhttp to http, once i have modified all my
local programs to use this new lib (instead of an older version)
- lib: use factotum to deal with auth requests?
- lib: do ssl better, e.g. with verifying certificates. but that
is a more generic inferno problem. same with problem that
non-"connection-close" connections hang until timeout (ssl libs
read() is like a readn(), and we use bufio so more data is requested
then is present).
- lib: check ndb to see if a proxy should be used, not per request?
that means all programs using http lib get proxy stuff for free,
without having to set anything. but cannot be disabled either...
- lib: for ssl, use CONNECT to talk to the remote host?
- write manual page for library? once it stabilizes
- lib: document somewhere that using "accept-encoding: deflate"
won't work with some webservers since those webservers return rfc1951
deflate data, instead of rfc1950 zlib.
- hget: reinstate -n for allowing redirs, and -R for sending referers.