Created
January 25, 2010 06:24
-
-
Save juvenn/285668 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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