Module: Purr

Defined in:
lib/purr.rb,
lib/purr/server.rb,
lib/purr/version.rb

Overview

A Rack-based server capable of smuggling TCP traffic through a persisent HTTP connection

It uses the Rack socket hijacking API for accessing the TCP level of an incoming HTTP session. The remote endpoint selection should be implemented as a block passed to the server returning an two element array containing a host string and a port integer.

Examples:

Simple rackup file for a local SSH connection

require 'purr'

# This middleware is to support optional logging
use Rack::Logger

app = Purr.server do |env|
  ['localhost', 22]
end

run app

See Also:

Defined Under Namespace

Classes: Server

Constant Summary collapse

VERSION =
'0.1.0'.freeze
SUPPORT =
%w(0.1.0).freeze

Class Method Summary collapse

Class Method Details

.server(&block) ⇒ Object

Creates or returns a singleton instance of the Rack-server



29
30
31
# File 'lib/purr.rb', line 29

def server(&block)
  @server ||= Server.new(&block)
end