Skip to content

Instantly share code, notes, and snippets.

@Maciek416
Created February 19, 2010 18:12
Show Gist options
  • Select an option

  • Save Maciek416/308996 to your computer and use it in GitHub Desktop.

Select an option

Save Maciek416/308996 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'eventmachine'
module Server
def receive_data data
send_data "HTTP/1.1 200 OK\n\r\n\rHello World"
close_connection_after_writing
end
end
EM.run do
EM.start_server('localhost', 80, Server)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment