Class: EventMachine::Protocols::CONNECT
- Inherits:
-
Proxy
- Object
- Connection
- Proxy
- EventMachine::Protocols::CONNECT
- Defined in:
- lib/eventmachine/protocols/connect.rb
Instance Method Summary collapse
Instance Method Details
#receive_message(msg) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/eventmachine/protocols/connect.rb', line 10 def (msg) return unless msg.include?("\r\n\r\n") || msg.include?("\n\n") match = msg.match(REQLINE) or return failure(:invalid_request) host, port, httpv = match.captures completion = proxy_to(host, port) completion.callback do |server| server.send_data(match.post_match) send_data("#{httpv} 200 Connection established\r\n\r\n") end completion.errback { |e| failure(e) } true # done end |