Port no longer included in token when using --host-token

This commit is contained in:
josedpedroso 2018-07-12 20:21:08 +01:00
parent 8cb89d2340
commit d80c607cb6
1 changed files with 7 additions and 0 deletions

View File

@ -146,8 +146,15 @@ Traffic Legend:
# in the form of token: host:port
if self.host_token:
# Use hostname as token
token = self.headers.get('Host')
# Remove port from hostname, as it'll always be the one where
# websockify listens (unless something between the client and
# websockify is redirecting traffic, but that's beside the point)
if token:
token = token.partition(':')[0]
else:
# Extract the token parameter from url
args = parse_qs(urlparse(self.path)[4]) # 4 is the query from url