lib/shadowsocks/server.rb in shadowsocks-0.3 vs lib/shadowsocks/server.rb in shadowsocks-0.4
- old
+ new
@@ -9,20 +9,20 @@
server.stage = 5
end
def receive_data data
- server.send_data encrypt(table[:encrypt_table], data)
+ server.send_data encrypt(data)
outbound_checker
end
end
class ServerListener < ::Shadowsocks::Listener
private
def data_handler data
- data = encrypt table[:decrypt_table], data
+ data = decrypt data
case stage
when 0
fireup_tunnel data
when 4
cached_pieces.push data
@@ -39,10 +39,10 @@
if data.size > header_length
cached_pieces.push data[header_length, data.size]
end
- @connector = EventMachine.connect @remote_addr, @remote_port, RequestConnector, self, table
+ @connector = EventMachine.connect @remote_addr, @remote_port, RequestConnector, self, crypto
rescue Exception => e
warn e
connection_cleanup
end
end