socksify 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/socksify.rb +8 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de7d71ec280f514fb083bd26f34b76ce14a2c82d
|
4
|
+
data.tar.gz: 10454a02092c6e14884441f90997b17ed92ee27a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bb3836afe02eadd52465295fe8428e3e9424a139271abf08951722a3195bf56b0093611c80a557e1d836faf0a498f3795953caf63e9a32ec0175562e9dc4b6c
|
7
|
+
data.tar.gz: 00deeb904f05fe9be737fbae6b2633ecc234b81c9841c4fd99718076b0b657b3d24399b5e890ff884e7e5899644191b7272a0f59b22e59beb6324230fa109210
|
data/lib/socksify.rb
CHANGED
@@ -191,6 +191,9 @@ class TCPSocket
|
|
191
191
|
end
|
192
192
|
Socksify::debug_debug "Waiting for authentication reply"
|
193
193
|
auth_reply = recv(2)
|
194
|
+
if auth_reply.empty?
|
195
|
+
raise SOCKSError.new("Server doesn't reply authentication")
|
196
|
+
end
|
194
197
|
if auth_reply[0..0] != "\004" and auth_reply[0..0] != "\005"
|
195
198
|
raise SOCKSError.new("SOCKS version #{auth_reply[0..0]} not supported")
|
196
199
|
end
|
@@ -217,6 +220,7 @@ class TCPSocket
|
|
217
220
|
|
218
221
|
# Connect
|
219
222
|
def socks_connect(host, port)
|
223
|
+
port = Socket.getservbyname(port) if port.is_a?(String)
|
220
224
|
Socksify::debug_debug "Sending destination address"
|
221
225
|
write TCPSocket.socks_version
|
222
226
|
Socksify::debug_debug TCPSocket.socks_version.unpack "H*"
|
@@ -261,6 +265,9 @@ class TCPSocket
|
|
261
265
|
Socksify::debug_debug "Waiting for SOCKS reply"
|
262
266
|
if @@socks_version == "5"
|
263
267
|
connect_reply = recv(4)
|
268
|
+
if connect_reply.empty?
|
269
|
+
raise SOCKSError.new("Server doesn't reply")
|
270
|
+
end
|
264
271
|
Socksify::debug_debug connect_reply.unpack "H*"
|
265
272
|
if connect_reply[0..0] != "\005"
|
266
273
|
raise SOCKSError.new("SOCKS version #{connect_reply[0..0]} is not 5")
|
@@ -330,7 +337,7 @@ module Socksify
|
|
330
337
|
end
|
331
338
|
s.write [0].pack('n') # Port
|
332
339
|
|
333
|
-
addr,
|
340
|
+
addr, _port = s.socks_receive_reply
|
334
341
|
Socksify::debug_notice "Resolved #{host} as #{addr} over SOCKS"
|
335
342
|
addr
|
336
343
|
ensure
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socksify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephan Maka
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
17
17
|
dependencies: []
|
18
18
|
description:
|
19
19
|
email: stephan@spaceboyz.net
|
@@ -51,9 +51,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
51
|
version: '0'
|
52
52
|
requirements: []
|
53
53
|
rubyforge_project: socksify
|
54
|
-
rubygems_version: 2.
|
54
|
+
rubygems_version: 2.4.5
|
55
55
|
signing_key:
|
56
56
|
specification_version: 4
|
57
57
|
summary: Redirect all TCPSockets through a SOCKS5 proxy
|
58
58
|
test_files: []
|
59
|
-
has_rdoc: false
|