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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6915d560fbce3e1186bb464228a7d4410a26ea6f
4
- data.tar.gz: 3d3bcfdf35263f756a999dd0e806a4da0a87eee4
3
+ metadata.gz: 652418372dd0d050059f97f7eb6f6d18fe6cdf0a
4
+ data.tar.gz: 27de7ce8b9182ff61e7aa15833195db7ce113b41
5
5
  SHA512:
6
- metadata.gz: d68b20eab72c3834e511ef2bba0cd4e1f9f24a8d92cb8a7638ac42cf0cd0b7bcbf352f136f1aa95f6aa8bf56ecd726d5a7e1ed00107120f5c38df78672917c4e
7
- data.tar.gz: 635cd51e99d28a009cf9bab11e1c6f79f5a5670f3fed9562f88103dcabde41023514d8af98de06a8c0f10eabde4606c0ad89851d0a54172b59fe76caab483dcc
6
+ metadata.gz: 92fa6a839e64a6b70f743ac21139768f9119a0bdc19f2dd033a777b36cb06c818a40e0d5f106d5612238f308f63ee5fadd05ea5e4b882373a4c0303a5707cbac
7
+ data.tar.gz: 31e2b180cf31677a96b0cc6fbe7ed26b6c8b5c0e24895559970391da92bd4e61eae6e400577251c7403b39e69dde480db17a8bba32e014cb2ce3db80682c26a8
@@ -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)
@@ -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
- if host !~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/
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
@@ -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
 
@@ -21,7 +21,7 @@
21
21
  module Sockit
22
22
 
23
23
  unless const_defined?(:VERSION)
24
- VERSION = "1.2.2"
24
+ VERSION = "1.2.3"
25
25
  end
26
26
 
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sockit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Patten