10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/socks_handler/tcpsocket_socksify.rb', line 10
def initialize(remote_host, remote_port, local_host = nil, local_port = nil, connect_timeout: nil)
rule = SocksHandler::TCP.find_rule(remote_host)
return super if rule.nil? || rule.direct
super(rule.host, rule.port, local_host, local_port, connect_timeout: connect_timeout)
begin
SocksHandler::TCP.establish_connection(self, remote_host, remote_port, rule.username, rule.password)
rescue
close
raise
end
end
|