class Async::HTTP::Proxy

def connect(&block)

Returns:
  • (Socket) - a connected bi-directional socket.
def connect(&block)
	input = Body::Writable.new
	
	response = @client.connect(@address.to_s, @headers, input)
	
	pipe = Body::Pipe.new(response.body, input)
	
	return pipe.to_io unless block_given?
	
	begin
		yield pipe.to_io
	ensure
		pipe.close
	end
end