Merge pull request #564 from pypeclub/bugfix/missing_port_variable

set port variable to None so the variable exists
This commit is contained in:
Milan Kolar 2020-10-01 18:22:26 +02:00 committed by GitHub
commit fd1e6dd3c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,12 +31,13 @@ class WebSocketServer():
self.client = None
self.handlers = {}
port = None
websocket_url = os.getenv("WEBSOCKET_URL")
if websocket_url:
parsed = urllib.parse.urlparse(websocket_url)
port = parsed.port
if not port:
port = 8099 # fallback
port = 8098 # fallback
self.app = web.Application()