       serverResponse.writeHead clientResponse.statusCode, clientResponse.headers
       sys.pump clientResponse, serverResponse
 
+# Public API for creating a **Client**
 exports.createConnection = (port, host) ->
   client = new Client
   client.port = port

      # Catch and emit as a socket error
      @socket.emit 'error', error

exports.Client = class Client extends Stream
  reconnect: ->
    if @readyState is 'closed'
      @connect @port, @host

  request: (args...) ->
    @reconnect()
    request = new ClientRequest @, args...
    request

  proxyRequest: (serverRequest, serverResponse) ->
    metaVariables =
      "REMOTE_ADDR": serverRequest.connection.remoteAddress

{EventEmitter}        = require 'events'
{BufferedWriteStream} = require './buffered'

# A **ClientRequest** is returned when `Client.request()` is called.
#
# It is a Writable Stream and responds to the conventional
# `write` and `end` methods.
#
# Its also an EventEmitter with the following events:
#
#   Event 'response'
#   function (response) { }
