D
Diego Bernardes
I need a dynamic port forwarding application, i listem packets from a ip
on port 10000, then i need not just send the data i receive to other
ports, but i need first create a connection on this new port first and
listen to any connection on this port, if i get any thing on this port i
send back through the first connection.
Its easy to create a single server with EventMachine like the code
below:
require 'rubygems'
require 'eventmachine'
module Echo
def receive_data data
send_data data
end
end
EM.run {
EM.start_server "0.0.0.0", 10000, Echo
}
But how could i create another server inside the current server?
on port 10000, then i need not just send the data i receive to other
ports, but i need first create a connection on this new port first and
listen to any connection on this port, if i get any thing on this port i
send back through the first connection.
Its easy to create a single server with EventMachine like the code
below:
require 'rubygems'
require 'eventmachine'
module Echo
def receive_data data
send_data data
end
end
EM.run {
EM.start_server "0.0.0.0", 10000, Echo
}
But how could i create another server inside the current server?