Skip to content

Commit

Permalink
Merge pull request #18 from jcs/master
Browse files Browse the repository at this point in the history
add on_connect callback
  • Loading branch information
axsuul committed Jun 23, 2017
2 parents 9c96ae8 + adfcc42 commit 466b552
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -34,6 +34,7 @@ class WordpressController < ApplicationController

# There's also other callbacks:
# - on_set_cookies
# - on_connect
# - on_response
# - on_set_cookies
# - on_success
Expand Down
2 changes: 2 additions & 0 deletions lib/reverse_proxy/client.rb
Expand Up @@ -7,6 +7,7 @@ class Client
@@callback_methods = [
:on_response,
:on_set_cookies,
:on_connect,
:on_success,
:on_redirect,
:on_missing,
Expand Down Expand Up @@ -87,6 +88,7 @@ def request(env, options = {}, &block)

# Make the request
Net::HTTP.start(uri.hostname, uri.port, http_options) do |http|
callbacks[:on_connect].call(http)
target_response = http.request(target_request)
end

Expand Down

0 comments on commit 466b552

Please sign in to comment.