Class: Shadowsocks::Server::RequestConnector

Inherits:
Tunnel
  • Object
show all
Defined in:
lib/shadowsocks/server.rb

Constant Summary

Constants inherited from Connection

Connection::BackpressureLevel

Instance Attribute Summary

Attributes inherited from Tunnel

#server

Attributes inherited from Connection

#crypto

Instance Method Summary collapse

Methods inherited from Tunnel

#initialize, #remote, #unbind

Constructor Details

This class inherits a constructor from Shadowsocks::Tunnel

Instance Method Details

#post_initObject



4
5
6
7
8
9
10
11
# File 'lib/shadowsocks/server.rb', line 4

def post_init
  p "connecting #{server.remote_addr} via #{server.config.server}"

  server.cached_pieces.each { |piece| send_data piece }
  server.cached_pieces = nil

  server.stage = 5
end

#receive_data(data) ⇒ Object



13
14
15
16
# File 'lib/shadowsocks/server.rb', line 13

def receive_data data
  server.send_data encrypt(data)
  outbound_checker
end