README.md in proxymachine-0.2.3 vs README.md in proxymachine-0.2.6

- old
+ new

@@ -18,24 +18,25 @@ contents of the transmission, then ProxyMachine will make your life easy! The idea here is simple. For each client connection, start receiving data chunks and placing them into a buffer. Each time a new chunk arrives, send the buffer to a user specified block. The block's job is to parse the buffer to -determine where the connection should proxied. If the buffer contains enough -data to make a determination, the block returns the address and port of the -correct backend server. If not, it can choose to either do nothing and wait -for more data to arrive, or close the connection. Once the block returns an -address, a connection to the backend is made, the buffer is replayed to the -backend, and the client and backend connections are hooked up to form a -straight proxy. This bidirectional proxy continues to exist until either the -client or backend close the connection. +determine where the connection should be proxied. If the buffer contains +enough data to make a determination, the block returns the address and port of +the correct backend server. If not, it can choose to do nothing and wait for +more data to arrive, close the connection, or close the connection after +sending custom data. Once the block returns an address, a connection to the +backend is made, the buffer is replayed to the backend, and the client and +backend connections are hooked up to form a transparent proxy. This +bidirectional proxy continues to exist until either the client or backend +close the connection. Installation ------------ - gem install mojombo-proxymachine -s http://gems.github.com + $ gem install proxymachine -s http://gemcutter.org Running ------- @@ -46,10 +47,23 @@ -c, --config CONFIG Configuration file -h, --host HOST Hostname to bind. Default 0.0.0.0 -p, --port PORT Port to listen on. Default 5432 +Signals +------- + + QUIT - Graceful shutdown. Stop accepting connections immediately and + wait as long as necessary for all connections to close. + + TERM - Fast shutdown. Stop accepting connections immediately and wait + up to 10 seconds for connections to close before forcing + termination. + + INT - Same as TERM + + Example routing config file --------------------------- class GitRouter # Look at the routing table and return the correct address for +name+ @@ -61,11 +75,11 @@ # Perform content-aware routing based on the stream data. Here, the # header information from the Git protocol is parsed to find the # username and a lookup routine is run on the name to find the correct # backend server. If no match can be made yet, do nothing with the - # connection yet. + # connection. proxy do |data| if data =~ %r{^....git-upload-pack /([\w\.\-]+)/[\w\.\-]+\000host=\w+\000} name = $1 { :remote => GitRouter.lookup(name) } else @@ -78,10 +92,10 @@ ------------------- `{ :remote => String }` - String is the host:port of the backend server that will be proxied. `{ :remote => String, :data => String }` - Same as above, but send the given data instead. `{ :noop => true }` - Do nothing. -`{ :close` => true } - Close the connection. +`{ :close => true }` - Close the connection. `{ :close => String }` - Close the connection after sending the String. Contribute ---------- \ No newline at end of file