class RProxy::CallbackConnection
Public Class Methods
new(uri, user, pass, value, tls)
click to toggle source
# File lib/r_proxy/callback_connection.rb, line 3 def initialize(uri, user, pass, value, tls) @uri = uri @path = uri.path.empty? ? '/' : uri.path @http_request = RProxy::HttpPostTemplate. new(@uri, @path).create(user, pass, value) @response = '' @need_tls = tls end
Public Instance Methods
assign_logger(logger)
click to toggle source
# File lib/r_proxy/callback_connection.rb, line 12 def assign_logger(logger) @logger = logger end
connection_completed()
click to toggle source
# File lib/r_proxy/callback_connection.rb, line 25 def connection_completed send_data(@http_request) if !@need_tls end
post_init()
click to toggle source
# File lib/r_proxy/callback_connection.rb, line 16 def post_init start_tls if @need_tls set_comm_inactivity_timeout(20) end
receive_data(data)
click to toggle source
# File lib/r_proxy/callback_connection.rb, line 29 def receive_data(data) @response = data.split("\r\n")[0] close_connection end
ssl_handshake_completed()
click to toggle source
# File lib/r_proxy/callback_connection.rb, line 21 def ssl_handshake_completed send_data(@http_request) end
unbind()
click to toggle source
# File lib/r_proxy/callback_connection.rb, line 34 def unbind @logger.info("#{@uri.host}#{@path} response status: #{@response}") if @logger end