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.
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: 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: document somewhere that using "accept-encoding: deflate" won't work with some webservers since those webservers return rfc1951 deflate data, instead of rfc1950 zlib.
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-20.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 |
|---|---|---|---|---|
| 20 | 9bafcf433dff | 14 months | diff | fix reading gzip/deflate responses. |
| 19 | 6812df380408 | 2 years | diff | add mkconfig and mention it in README. |
| 18 | e91e2146623a | 2 years | diff | recognize more url schemes than just http and https. |
| 17 | 8dc91eb0ce2c | 2 years | diff | undo previous change with strict scheme checking. things depend o... |
| 16 | e08f1581817a | 2 years | diff | very minor changes (docs, tiny bug fix). |
| 15 | 270dc25c471c | 2 years | diff | basic "get" function. not complete yet as it doesn't handle redir... |
| 14 | e44de51ce0c0 | 3 years | diff | mention licence and me as author. show some tests for post requests. |
| 13 | 27ec669b10da | 3 years | diff | add hget, a simple http client that uses the library. it gets a m... |
| 12 | 434bdbcc27e7 | 3 years | diff | remove bogus target nuke. |
| 11 | f34924183c7e | 3 years | diff | fix mkfiles, for /man & /module (nuking & prepare for man page ins... |
| 10 | 9af051b54d30 | 4 years | diff | add methodstr to adt Req. Req.read now sets .method to UNKNOWN if... |
| 9 | 31b70f201ccf | 4 years | diff | better error messages, with quoted original strings. |
| 8 | d281728ce33d | 4 years | diff | print which method name is unrecognized, for more useful error mes... |
| 7 | 0d6a7c7eb242 | 4 years | diff | do not code/decode query-part of url, that entirely breaks the sem... |
| 6 | 1987d78fd828 | 4 years | diff | make Hdrs.get not append header values. that is only allowed for ... |
| 5 | 0e9a2613731b | 4 years | diff | fix continued headers. well, they sort of worked, but leading and... |
| 4 | b828e8c2c59f | 4 years | diff | make majoro/minor version explicit. this allows us to treat http/... |
| 3 | 666180c07f57 | 4 years | diff | dial proxyaddr if it is set. |
| 2 | 41eece090646 | 4 years | diff | implement Req.read. |
| 1 | fd984cf188fe | 4 years | diff | install instructions |
| 0 | 066be3872de6 | 4 years | - | initial version, it's a rewritten previous version of http.m. thi... |