Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 26bbc0cf8c
Fetching contributors…

Cannot retrieve contributors at this time

file 16 lines (13 sloc) 0.291 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
require 'eventmachine'

module EchoServer
  def post_init
    puts "-- someone connected to the echo server!"
  end

  def receive_data(data)
    send_data ">>> you sent: #{data}"
  end
end

EM.run do
  EM.start_server("127.0.0.1", 8081, EchoServer)
  puts 'running echo server on 8081'
end
Something went wrong with that request. Please try again.