Skip to content

Instantly share code, notes, and snippets.

@juvenn
Created January 25, 2010 06:24
Show Gist options
  • Save juvenn/285668 to your computer and use it in GitHub Desktop.
Save juvenn/285668 to your computer and use it in GitHub Desktop.
class PuSHCallback < EM::Connection
include EM::HttpServer
def post_init
puts Time.now.to_s + "> New callback initialized"
end
def process_http_request
response = EM::DelegatedHttpResponse.new(self)
puts Time.now.to_s + "> Verify requset from " + @http_request_uri
response.status = 200
response.content_type = "text/html"
response.content = @http_request_query_string["hub.challenge"]
response.send_response
end
end
EM.run {
EM.start_server "0.0.0.0", 8082, PuSHCallback
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment