Skip to content
Snippets Groups Projects
Commit 4343d706 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

use default port for bosh proxy when none is provided. Fixes #5400, #5401

parent 124483ea
No related branches found
No related tags found
No related merge requests found
......@@ -56,9 +56,18 @@ def get_proxy_data_from_dict(proxy):
proxy_type = proxy['type']
if proxy_type == 'bosh' and not proxy['bosh_useproxy']:
# with BOSH not over proxy we have to parse the hostname from BOSH URI
tcp_host = urisplit(proxy['bosh_uri'])[1]
tcp_host, tcp_port = tcp_host.split(':', 1)
tcp_port = int(tcp_port)
proto, tcp_host, path = urisplit(proxy['bosh_uri'])
spl = tcp_host.split(':', 1)
if len(spl) == 1:
# No port were set
tcp_host = tcp_host[0]
if proto == 'https':
tcp_port = 443
else:
tcp_port = 80
else:
tcp_host, tcp_port = spl
tcp_port = int(tcp_port)
else:
# with proxy!=bosh or with bosh over HTTP proxy we're connecting to proxy
# machine
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment