information about this package can be found in the README. here is a html-version of the README:
useful, but probably has some buglets lingering in rarely exercised code paths.
this is a http library, and simple sample http download client. the library supports both reading & writing requests & responses.
some features:
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 http chunks)
get the latest version from:
http://www.ueber.net/code/r/http
make sure you have $ROOT set, now "mk install" to compile and install the files.
when building from within inferno, insert SYSHOST=Inferno and ROOT= in the mk invocations to override the values in the mkconfig.
this code is in the public domain, written by mechiel lukkien, reachable at mechiel@ueber.net or mechiel@xs4all.nl.
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: 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: add higher-level functions for retrieving urls? that do redirects too? old lib had that. get() needs to be improved.
lib: detect content-range in response, and read less. now we never complete reading the response body.
lib: allow some events on high-level request (which handles redirects) send info on a channel (info about redirections). perhaps other info too.
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...
to clone & pull:
hg clone http://www.ueber.net/hgsrv/http/
hg clone static-http://www.ueber.net/who/mjl/hg/http/
download a snapshot of the latest version: http-19.tgz.
the files in the latest revision can be found at /hg/http/files/tip/. a specific revision can be access by replacing "tip" with the revision number, (partial) nodeid or tag name. a few direct links to useful files in the latest revision:
| rev | nodeid | when | diff | why |
|---|---|---|---|---|
| 19 | 6812df380408 | 6 weeks | diff | add mkconfig and mention it in README. |
| 18 | e91e2146623a | 5 months | diff | recognize more url schemes than just http and https. |
| 17 | 8dc91eb0ce2c | 6 months | diff | undo previous change with strict scheme checking. things depend o... |
| 16 | e08f1581817a | 6 months | diff | very minor changes (docs, tiny bug fix). |
| 15 | 270dc25c471c | 7 months | diff | basic "get" function. not complete yet as it doesn't handle redir... |
| 14 | e44de51ce0c0 | 17 months | diff | mention licence and me as author. show some tests for post requests. |
| 13 | 27ec669b10da | 17 months | diff | add hget, a simple http client that uses the library. it gets a m... |
| 12 | 434bdbcc27e7 | 19 months | diff | remove bogus target nuke. |
| 11 | f34924183c7e | 19 months | diff | fix mkfiles, for /man & /module (nuking & prepare for man page ins... |
| 10 | 9af051b54d30 | 2 years | diff | add methodstr to adt Req. Req.read now sets .method to UNKNOWN if... |
| 9 | 31b70f201ccf | 2 years | diff | better error messages, with quoted original strings. |
| 8 | d281728ce33d | 2 years | diff | print which method name is unrecognized, for more useful error mes... |
| 7 | 0d6a7c7eb242 | 2 years | diff | do not code/decode query-part of url, that entirely breaks the sem... |
| 6 | 1987d78fd828 | 2 years | diff | make Hdrs.get not append header values. that is only allowed for ... |
| 5 | 0e9a2613731b | 2 years | diff | fix continued headers. well, they sort of worked, but leading and... |
| 4 | b828e8c2c59f | 2 years | diff | make majoro/minor version explicit. this allows us to treat http/... |
| 3 | 666180c07f57 | 2 years | diff | dial proxyaddr if it is set. |
| 2 | 41eece090646 | 2 years | diff | implement Req.read. |
| 1 | fd984cf188fe | 2 years | diff | install instructions |
| 0 | 066be3872de6 | 2 years | - | initial version, it's a rewritten previous version of http.m. thi... |