Sha256: f8899e7cf4cc820ee237640d0de844249889028dde4139b76f0f90f6b68e394e

Contents?: true

Size: 501 Bytes

Versions: 26

Compression:

Stored size: 501 Bytes

Contents

# -*- encoding: binary -*-
# :enddoc:
module Rainbows::ReverseProxy::Synchronous
  UpstreamSocket = Rainbows::ReverseProxy::UpstreamSocket

  def each_block(input)
    buf = ""
    while input.read(16384, buf)
      yield buf
    end
  end

  def call(env)
    input = prepare_input!(env)
    req = build_headers(env, input)
    sock = UpstreamSocket.new(pick_upstream(env))
    sock.write(req)
    each_block(input) { |buf| sock.kgio_write(buf) } if input
    Kcar::Response.new(sock).rack
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
rainbows-5.2.1 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-5.2.0 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-5.1.1 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-5.1.0 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-5.0.0.5.ge717 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-5.0.0 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.7.0 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.6.2 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.6.1 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.6.0.4.g4108 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.6.0 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.5.0 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.4.3 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.4.2 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.4.1.1.gd5c8c lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.4.1 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.4.0 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.3.1 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.3.0 lib/rainbows/reverse_proxy/synchronous.rb
rainbows-4.2.0 lib/rainbows/reverse_proxy/synchronous.rb