sockit 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sockit.rb +1 -1
- data/lib/sockit/connection.rb +1 -3
- data/lib/sockit/support.rb +8 -0
- data/lib/sockit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 652418372dd0d050059f97f7eb6f6d18fe6cdf0a
|
4
|
+
data.tar.gz: 27de7ce8b9182ff61e7aa15833195db7ce113b41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92fa6a839e64a6b70f743ac21139768f9119a0bdc19f2dd033a777b36cb06c818a40e0d5f106d5612238f308f63ee5fadd05ea5e4b882373a4c0303a5707cbac
|
7
|
+
data.tar.gz: 31e2b180cf31677a96b0cc6fbe7ed26b6c8b5c0e24895559970391da92bd4e61eae6e400577251c7403b39e69dde480db17a8bba32e014cb2ce3db80682c26a8
|
data/lib/sockit.rb
CHANGED
@@ -97,7 +97,7 @@ class TCPSocket
|
|
97
97
|
alias :initialize_tcp :initialize
|
98
98
|
|
99
99
|
def initialize(remote_host, remote_port, local_host=nil, local_port=nil)
|
100
|
-
if Sockit.enabled? && Sockit.connect_via_socks?(remote_host)
|
100
|
+
if Sockit.enabled? && Sockit.connect_via_socks?(Sockit.resolve(remote_host))
|
101
101
|
initialize_tcp(Sockit.config.host, Sockit.config.port)
|
102
102
|
Sockit.perform_v5_authenticate(self) if Sockit.is_socks_v5?
|
103
103
|
Sockit.connect(self, remote_host, remote_port)
|
data/lib/sockit/connection.rb
CHANGED
@@ -11,9 +11,7 @@ module Sockit
|
|
11
11
|
log(:yellow, "Connecting to SOCKS v#{config.version} server #{config.host}:#{config.port}")
|
12
12
|
|
13
13
|
# when doing proxy mode on SS5; we seemingly need to resolve all names first.
|
14
|
-
|
15
|
-
host = Resolv::DNS.new.getaddress(host).to_s
|
16
|
-
end
|
14
|
+
host = Sockit.resolve(host)
|
17
15
|
|
18
16
|
data = case config.version.to_i
|
19
17
|
when 4 then
|
data/lib/sockit/support.rb
CHANGED
@@ -36,6 +36,14 @@ module Sockit
|
|
36
36
|
puts("%s%s.%06d %s%s" % [COLORS[color], timestamp.strftime("%Y-%m-%d|%H:%M:%S"), timestamp.usec, message, COLORS[:reset]])
|
37
37
|
end
|
38
38
|
|
39
|
+
def resolve(host)
|
40
|
+
# when doing proxy mode on SS5; we seemingly need to resolve all names first.
|
41
|
+
if host !~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/
|
42
|
+
host = Resolv::DNS.new.getaddress(host).to_s
|
43
|
+
end
|
44
|
+
host
|
45
|
+
end
|
46
|
+
|
39
47
|
def dump(action, data)
|
40
48
|
return if !config.debug
|
41
49
|
|
data/lib/sockit/version.rb
CHANGED