GIT-VERSION-GEN: fix install for non-tag versions
[kcar.git] / README
blob6fb3dd98862ccba307401ec63cb9e40205375c8f
1 = kcar - bytestream to Rack response converter
3 kcar features an HTTP parser that will convert a bytestream into a
4 3-element array suitable for use as a Rack response.  It is IO interface
5 agnostic, so it may be used with HTTP streams over Unix domain sockets,
6 regular files, FIFOs, StringIOs as well as traditional TCP sockets.
8 == Features
10 * RFC2616-compliant Ragel+C parser adapted from Unicorn and Mongrel
12 * decodes chunked response bodies with an optional pass-through mode
13   (to avoid rechunking with Rack::Chunked)
15 * handles odd things like trailers and multiline headers
17 * streaming interface for response bodies allows for incremental
18   processing of arbitrarily large responses.
20 * supported under Ruby 1.9 and later.
22 == Problems
24 * kcar is only lightly tested and is not yet aware of all quirks found in
25   all real (possibly broken) web servers.
27 == Install
29 If you're using a packaged Ruby distribution, make sure you have a C
30 compiler and the matching Ruby development libraries and headers.
32 If you use RubyGems:
34     gem install kcar
36 Otherwise grab the latest tarball from:
38 http://bogomips.org/kcar/files/
40 Unpack it, and run "ruby setup.rb"
42 == Usage:
44 While you can use the Kcar::Parser directly, you'll usually want the
45 higher-level interface of Kcar::Response:
47     require 'rack' # for Rack::Utils::HeaderHash, which is optional
48     require 'socket' # for TCPSocket
49     require 'kcar'
50     sock = TCPSocket.new('example.com', 80)
51     sock.write("GET / HTTP/1.0\r\n\r\n")
53     # instead of a Rack::Utils::HeaderHash object below, you can also
54     # pass a regular Hash or Array object.
55     response = Kcar::Response.new(sock, Rack::Utils::HeaderHash.new)
56     status, headers, body = response.rack
58 You can now do further processing on the status, headers, or iterate
59 through the body with body.each.
61 == Development
63 You can get the latest source via git from the following locations:
65   git://bogomips.org/kcar.git
66   git://repo.or.cz/kcar.git (mirror)
68 You may browse the code from the web and download the latest snapshot
69 tarballs here:
71 * http://bogomips.org/cgit/kcar.git (cgit)
72 * http://repo.or.cz/w/kcar.git (gitweb)
74 Inline patches (from "git format-patch") to the mailing list are
75 preferred because they allow code review and comments in the reply to
76 the patch.
78 We will adhere to mostly the same conventions for patch submissions as
79 git itself.  See the Documentation/SubmittingPatches document
80 distributed with git on on patch submission guidelines to follow.  Just
81 don't email the git mailing list or maintainer with kcar patches.
83 == Contact
85 All feedback (bug reports, user/development discussion, patches, pull
86 requests) go to the mailing list: mailto:kcar-public@bogomips.org
88 Mailing list archives are available here:
90 http://bogomips.org/kcar-public/