Skip to content

Commit

Permalink
HTTP Proxy - Fix port extraction & whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
RageLtMan committed Aug 30, 2018
1 parent 83af143 commit 524739f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/rex/proto/http/proxy.rb
Expand Up @@ -94,8 +94,8 @@ def initialize(listen_port = 80, listen_host = '0.0.0.0', ssl = false, context =
self.ssl_cert = ssl_cert
self.proxies = proxies
self.rewrite_proxy_headers = rewrite_proxy_headers
self.connect_host = connect_host
self.connect_port = connect_port
self.connect_host = connect_host
self.connect_port = connect_port

self.clients = []
self.listener = nil
Expand Down Expand Up @@ -130,8 +130,8 @@ def start
'LocalHost' => self.listen_host,
'LocalPort' => self.listen_port,
'Context' => self.context,
'SSL' => self.ssl,
'SSLCert' => self.ssl_cert,
'SSL' => self.ssl,
'SSLCert' => self.ssl_cert,
'Comm' => self.comm
)

Expand Down Expand Up @@ -243,7 +243,7 @@ def proxy_header_rewrite(request)

def normalize_request_target(request)
# Extract host port and URI, map as appropriate, account for emtpy
target = request.uri[/\/([\w\d\.]+)/, 1]
target = request.uri[/\/([\w\d\.:]+)/, 1]

host,port = target.split(':')
targ_uri = request.uri[/\/[\w\d\.]+(\/.*)/,1]
Expand Down

0 comments on commit 524739f

Please sign in to comment.