Class: Proxi::TCPSocketFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/proxi/socket_factory.rb

Overview

### TCPSocketFactory

This is the most vanilla type of socket factory.

Suitable when all requests need to be forwarded to the same host and port.

Direct Known Subclasses

SSLSocketFactory

Instance Method Summary collapse

Constructor Details

#initialize(remote_host, remote_port) ⇒ TCPSocketFactory

Returns a new instance of TCPSocketFactory.



10
11
12
# File 'lib/proxi/socket_factory.rb', line 10

def initialize(remote_host, remote_port)
  @remote_host, @remote_port = remote_host, remote_port
end

Instance Method Details

#callObject



14
15
16
# File 'lib/proxi/socket_factory.rb', line 14

def call
  TCPSocket.new(@remote_host, @remote_port)
end