Sha256: 6dadae78d03a6343bcf23d05479002beab978c07715ae163b2a6be5e1871c3e7
Contents?: true
Size: 608 Bytes
Versions: 12
Compression:
Stored size: 608 Bytes
Contents
require 'eventmachine' require 'r_socks/connection_handler' require 'r_socks/config' module RSocks class TcpServer attr_reader :config def initialize(host = '127.0.0.1', port = 8081) @host = host @port = port @config = RSocks::Config.new end def run! begin start_tcp_server rescue Interrupt puts "" puts "RSocks TPC server closed now...." end end private def start_tcp_server EventMachine.run do EventMachine.start_server @host, @port, RSocks::ConnectionHandler, @config end end end end
Version data entries
12 entries across 12 versions & 1 rubygems