Class: UDPProxy::Server
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- UDPProxy::Server
- Defined in:
- lib/udp_proxy/server.rb
Instance Method Summary collapse
-
#initialize(address, relay_ip, relay_port) ⇒ Server
constructor
A new instance of Server.
- #receive_data(data) ⇒ Object
Constructor Details
Instance Method Details
#receive_data(data) ⇒ Object
8 9 10 11 12 |
# File 'lib/udp_proxy/server.rb', line 8 def receive_data(data) port, ip = Socket.unpack_sockaddr_in(get_peername) client = @clients.client(ip, port) client.send_datagram(data, @relay_ip, @relay_port) end |