Class: Shadowsocks::Local::ServerConnector
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
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(addr_to_send)
server.cached_pieces.each { |piece| send_data encrypt(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 decrypt(data)
outbound_scheduler
end
|