kcar.git  about / heads / tags
bytestream to Rack response converter
$ git log --pretty=format:'%h %s (%cs)%d' v0.4.0 --
cba0da8 kcar 0.4.0 - Kcar::Response improvement (2012-10-26)
	(tag: v0.4.0)
0f2c622 test_response: fix redefined method (2012-10-26)
b583fe8 add Kcar::Parser#body_bytes_left= setter method (2012-10-26)
7a51fde kcar 0.3.1 - Kcar::Response minor bugfix (2012-09-26)
	(tag: v0.3.1)
a942f4f response: propagate EOFError on remote errors (2012-09-25)
051bbf0 kcar 0.3.0 (2011-06-07)
	(tag: v0.3.0)
e7e9ad7 README: use librelist.org address (2011-05-23)
d6ff34a call rb_str_modify before rb_str_resize (2011-05-23)
c73e502 strip trailing and leading linear whitespace in headers (2011-05-23)
71bb473 pkg.mk: update for locale-independent grep (2011-05-23)
...

$ git cat-file blob v0.4.0:README
= kcar - bytestream to Rack response converter

kcar features an HTTP parser that will convert a bytestream into a
3-element array suitable for use as a Rack response.  It is IO interface
agnostic, so it may be used with HTTP streams over Unix domain sockets,
regular files, FIFOs, StringIOs as well as traditional TCP sockets.

== Features

* RFC2616-compliant Ragel+C parser adapted from Unicorn and Mongrel

* decodes chunked response bodies with an optional pass-through mode
  (to avoid rechunking with Rack::Chunked)

* handles odd things like trailers and multiline headers

* streaming interface for response bodies allows for incremental
  processing of arbitrarily large responses.

* suppported under Ruby 1.8, 1.9 and Rubinuus

== Problems

* kcar is only lightly tested and is not yet aware of all quirks found in
  all real (possibly broken) web servers.

== Install

If you're using a packaged Ruby distribution, make sure you have a C
compiler and the matching Ruby development libraries and headers.

If you use RubyGems:

    gem install kcar

Otherwise grab the latest tarball from:

http://bogomips.org/kcar/files/

Unpack it, and run "ruby setup.rb"

== Usage:

While you can use the Kcar::Parser directly, you'll usually want the
higher-level interface of Kcar::Response:

    require 'rack' # for Rack::Utils::HeaderHash, which is optional
    require 'socket' # for TCPSocket
    require 'kcar'
    sock = TCPSocket.new('example.com', 80)
    sock.write("GET / HTTP/1.0\r\n\r\n")

    # instead of a Rack::Utils::HeaderHash object below, you can also
    # pass a regular Hash or Array object.
    response = Kcar::Response.new(sock, Rack::Utils::HeaderHash.new)
    status, headers, body = response.rack

You can now do further processing on the status, headers, or iterate
through the body with body.each.

== Development

You can get the latest source via git from the following locations:

  git://bogomips.org/kcar.git
  git://repo.or.cz/kcar.git (mirror)

You may browse the code from the web and download the latest snapshot
tarballs here:

* http://bogomips.org/cgit/kcar.git (cgit)
* http://repo.or.cz/w/kcar.git (gitweb)

Inline patches (from "git format-patch") to the mailing list are
preferred because they allow code review and comments in the reply to
the patch.

We will adhere to mostly the same conventions for patch submissions as
git itself.  See the Documentation/SubmittingPatches document
distributed with git on on patch submission guidelines to follow.  Just
don't email the git mailing list or maintainer with kcar patches.

== Contact

All feedback (bug reports, user/development discussion, patches, pull
requests) go to the mailing list: mailto:kcar@librelist.org

The mailing list is mirrored to Gmane, all information about the
group is here:

http://gmane.org/info.php?group=gmane.comp.lang.ruby.kcar.general

Mailing list archives in mbox format may be downloaded here:

http://bogomips.org/kcar/archives/

# heads (aka `branches'):
$ git for-each-ref --sort=-creatordate refs/heads \
	--format='%(HEAD) %(refname:short) %(subject) (%(creatordate:short))'
* master       GNUmakefile: fix rsync destination for website (2020-02-21)

# tags:
$ git for-each-ref --sort=-creatordate refs/tags \
	--format='%(refname:short) %(subject) (%(creatordate:short))'
v0.7.0       kcar 0.7.0 (2020-02-21) tar.gz
v0.6.0       kcar 0.6.0 - minor cleanups (2015-08-04) tar.gz
v0.5.0       kcar 0.5.0 - GPL-2.0+, new mailing list, doc updates (2015-01-14) tar.gz
v0.4.0       kcar 0.4.0 - Kcar::Response improvement (2012-10-26) tar.gz
v0.3.1       kcar 0.3.1 - Kcar::Response minor bugfix (2012-09-26) tar.gz
v0.3.0       kcar 0.3.0 (2011-06-07) tar.gz
v0.2.0       kcar 0.2.0 - small improvements (2011-02-24) tar.gz
v0.1.2       kcar 0.1.2 - one bugfix for one liners (2010-11-30) tar.gz
v0.1.1       kcar 0.1.1 (2010-07-25) tar.gz
v0.1.0       kcar 0.1.0 - initial release (2010-04-28) tar.gz

# associated public inboxes:
# (number on the left is used for dev purposes)
            https://yhbt.net/kcar-public

git clone https://yhbt.net/kcar.git