Class: Tunnelss::HttpsProxy
- Includes:
- ConfigureWithPow
- Defined in:
- lib/tunnelss.rb
Instance Attribute Summary
Attributes inherited from HttpProxy
Instance Method Summary collapse
Methods included from ConfigureWithPow
#configure_with_pow, #pow_present?
Methods inherited from HttpProxy
#initialize, #unbind, #unbind_client
Constructor Details
This class inherits a constructor from Tunnelss::HttpProxy
Instance Method Details
#post_init ⇒ Object
115 116 117 118 119 120 121 |
# File 'lib/tunnelss.rb', line 115 def post_init if pow_present? start_tls(:private_key_file => "#{dir}/key.pem", :cert_chain_file => "#{dir}/server.crt", :verify_peer => false) else start_tls end end |
#receive_data(data) ⇒ Object
128 129 130 131 132 133 134 135 |
# File 'lib/tunnelss.rb', line 128 def receive_data(data) if !@x_forwarded_proto_header_inserted && data =~ /\r\n\r\n/ super data.gsub(/\r\n\r\n/, "\r\nX_FORWARDED_PROTO: https\r\n\r\n") @x_forwarded_proto_header_inserted = true else super end end |
#relay_from_client(data) ⇒ Object
123 124 125 126 |
# File 'lib/tunnelss.rb', line 123 def relay_from_client(data) super @x_forwarded_proto_header_inserted = false end |