r_socks 0.2.1 → 0.2.2
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/Gemfile.lock +1 -1
- data/lib/r_socks/connection_handler.rb +0 -5
- data/lib/r_socks/http_proxy_parser.rb +2 -2
- data/lib/r_socks/target_connection_handler.rb +7 -1
- data/lib/r_socks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b73f2605d39b4ee1dce1152cb6e2f8af9aa62479d1523fd29e678ce5e819faab
|
4
|
+
data.tar.gz: eba570347d689fdc8055b1207f39ffee4844defb92c06f50c15e13650555c911
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 950b11d08603dfd216390e30c744a040196f6593b520df915520caacf29d987b82ff1a765cdd12c2c6a37177d7286f9010bc040f7951559413f3aacc0335a2db
|
7
|
+
data.tar.gz: 89cecf21015b95818b2ef08f161c007b9da33e1f6b329de59e0d35a7297939454b6845876769f09b7d14d414ac8980822b39a0f014be4e0602c4ca5afdb8359e
|
data/Gemfile.lock
CHANGED
@@ -49,12 +49,7 @@ module RSocks
|
|
49
49
|
|
50
50
|
if @target.nil?
|
51
51
|
@target = EventMachine.connect(@addr, @port, RSocks::TargetConnectionHandler, self, @config)
|
52
|
-
if @config.proxy_type == :http
|
53
|
-
send_data(RSocks::HttpProxyResponseCodes::SUCCESS)
|
54
|
-
end
|
55
52
|
end
|
56
|
-
|
57
|
-
proxy_incoming_to(@target, @config.proxy_buffer_size)
|
58
53
|
rescue => error
|
59
54
|
puts "Error at #{@ip}:#{@port}, message: #{data}, error: #{error.message}"
|
60
55
|
puts error.backtrace
|
@@ -31,7 +31,7 @@ module RSocks
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def auth_user
|
34
|
-
temp = @header['
|
34
|
+
temp = @header['proxy-authorization']
|
35
35
|
pattern = /^Basic /
|
36
36
|
token = temp.gsub(pattern, '')
|
37
37
|
begin
|
@@ -60,7 +60,7 @@ module RSocks
|
|
60
60
|
arr.each do |val|
|
61
61
|
name, value = val.split(':')
|
62
62
|
next if name.nil?
|
63
|
-
header[name.strip] = value&.strip
|
63
|
+
header[name.strip.downcase] = value&.strip
|
64
64
|
end
|
65
65
|
@header = header
|
66
66
|
end
|
@@ -9,7 +9,13 @@ module RSocks
|
|
9
9
|
@config = config
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
12
|
+
def connection_completed
|
13
|
+
port, ip = Socket.unpack_sockaddr_in(get_peername)
|
14
|
+
puts "success connected to #{ip}:#{port}"
|
15
|
+
if @config.proxy_type == :http
|
16
|
+
@client.send_data(RSocks::HttpProxyResponseCodes::SUCCESS)
|
17
|
+
end
|
18
|
+
@client.proxy_incoming_to(self, @config.proxy_buffer_size)
|
13
19
|
proxy_incoming_to(@client, @config.proxy_buffer_size)
|
14
20
|
end
|
15
21
|
|
data/lib/r_socks/version.rb
CHANGED