Class: TransocksEM::TransocksClient

Inherits:
EM::P::Socks4
  • Object
show all
Defined in:
lib/transocks_em.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proxied, host, port) ⇒ TransocksClient

Returns a new instance of TransocksClient.



38
39
40
41
# File 'lib/transocks_em.rb', line 38

def initialize(proxied, host, port)
  @proxied = proxied
  super(host, port)
end

Instance Attribute Details

#closedObject

Returns the value of attribute closed.



36
37
38
# File 'lib/transocks_em.rb', line 36

def closed
  @closed
end

Instance Method Details

#proxy_target_unboundObject



48
49
50
# File 'lib/transocks_em.rb', line 48

def proxy_target_unbound
  close_connection
end

#receive_data(data) ⇒ Object



43
44
45
46
# File 'lib/transocks_em.rb', line 43

def receive_data(data)
  @proxied.send_data(data)
  proxy_incoming_to @proxied  unless @proxied.closed
end

#unbindObject



52
53
54
55
# File 'lib/transocks_em.rb', line 52

def unbind
  self.closed = true
  @proxied.close_connection_after_writing
end