Class: Tunnels::HttpsProxy

Inherits:
HttpProxy
  • Object
show all
Defined in:
lib/tunnels.rb

Instance Method Summary collapse

Methods inherited from HttpProxy

#initialize, #unbind, #unbind_client

Constructor Details

This class inherits a constructor from Tunnels::HttpProxy

Instance Method Details

#post_initObject



214
215
216
# File 'lib/tunnels.rb', line 214

def post_init
  start_tls
end

#receive_data(data) ⇒ Object



223
224
225
226
227
228
229
230
# File 'lib/tunnels.rb', line 223

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



218
219
220
221
# File 'lib/tunnels.rb', line 218

def relay_from_client(data)
  super
  @x_forwarded_proto_header_inserted = false
end