r_socks 0.1.7 → 0.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a7150f7711b2fa8807f99ae87e082947488effb625c3da5a5e4e6467a818535
4
- data.tar.gz: 7ab0d14e24184b511036e325d1f003611f53306f2e266f88ef0cb2f52561e37a
3
+ metadata.gz: 83fd1b16e6fe57dd2c8370023d0b2d2540fd472d871d304b14efb8cdef31db23
4
+ data.tar.gz: 617ab279bbb464955f8453dda146b8ea6d3e5b668232ebae316ce95c51487b74
5
5
  SHA512:
6
- metadata.gz: 1869580601e5c4795cc7f050f8f4683b2c07d7382a7d09b74831bf32fbe3083abf18121a6308649887999e75fc00a809225286cf228deb7491916044656ebac5
7
- data.tar.gz: 5e925d6a0b96ca93041a15221f47654f79bea9149afb9363d8aa2b5575f4d1baaa1a8221aa0ae4faacd66664311d55f27b031baef3a25099e705d702561a9324
6
+ metadata.gz: d9c5c5edf153de04d45bc21237b0c0d2a61c6b071d23daaaaad3eafb7668f0f15e77d268e249abfede7584e31fc685c1b3fecaad983cd215695df9a1d811d4a9
7
+ data.tar.gz: cb28113a10dfd13bb5597bd013bbb6b1a7c2570d6385c1aa60209d84a243147a1674106841dfed5df28435f0e7a9adcd76dba1a221036e442c9863a1d198fae3
@@ -26,5 +26,13 @@ module RSocks
26
26
  def auth_method
27
27
  @store[:auth_method]
28
28
  end
29
+
30
+ def proxy_buffer_size
31
+ @store[:proxy_buffer_size] || 1024 * 1024 * 10
32
+ end
33
+
34
+ def proxy_buffer_size=(value)
35
+ @store[:proxy_buffer_size] = value.to_i
36
+ end
29
37
  end
30
38
  end
@@ -61,10 +61,10 @@ module RSocks
61
61
  return send_data(not_accept) unless @state_machine.start?
62
62
 
63
63
  if @target.nil?
64
- @target = EventMachine.connect(@addr, @port, RSocks::TargetConnectionHandler, self, data)
64
+ @target = EventMachine.connect(@addr, @port, RSocks::TargetConnectionHandler, self, @config, data)
65
65
  end
66
66
 
67
- proxy_incoming_to(@target,60000)
67
+ proxy_incoming_to(@target, @config.proxy_buffer_size)
68
68
  rescue => error
69
69
  puts "Error at #{@ip}:#{@port}, message: #{data}, error: #{error.message}"
70
70
  puts error.backtrace
@@ -3,9 +3,10 @@ require 'eventmachine'
3
3
  module RSocks
4
4
  class TargetConnectionHandler < EM::Connection
5
5
 
6
- def initialize(client, data)
6
+ def initialize(client, config, data)
7
7
  @client = client
8
8
  @init_data = data
9
+ @config = config
9
10
  end
10
11
 
11
12
  def post_init
@@ -1,3 +1,3 @@
1
1
  module RSocks
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r_socks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick An