Class: Shadowsocks::Local::ServerConnector
- Inherits:
-
Tunnel
- Object
- EventMachine::Connection
- Connection
- Tunnel
- Shadowsocks::Local::ServerConnector
- Defined in:
- lib/shadowsocks/local.rb
Constant Summary
Constants inherited from Connection
Instance Attribute Summary
Attributes inherited from Tunnel
Instance Method Summary collapse
Methods inherited from Tunnel
#encrypt, #initialize, #remote, #unbind
Constructor Details
This class inherits a constructor from Shadowsocks::Tunnel
Instance Method Details
#post_init ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/shadowsocks/local.rb', line 4 def post_init p "connecting #{server.remote_addr[3..-1]} via #{server.config.server}" addr_to_send = server.addr_to_send.clone send_data encrypt(table[:encrypt_table], addr_to_send) server.cached_pieces.each { |piece| send_data encrypt(table[:encrypt_table], piece) } server.cached_pieces = [] server.stage = 5 end |
#receive_data(data) ⇒ Object
15 16 17 18 |
# File 'lib/shadowsocks/local.rb', line 15 def receive_data data server.send_data encrypt(table[:decrypt_table], data) outbound_checker end |