signalling/simple-server: Listen on both ipv4 and ipv6 by default

Empty string or `None` mean all interfaces. Specifying 0.0.0.0 means
ipv4 interfaces only.

Fixes https://github.com/centricular/gstwebrtc-demos/issues/120
This commit is contained in:
Nirbheek Chauhan 2019-07-16 02:31:56 +05:30
parent 48130e07a1
commit 7fe9f8e092

View file

@ -18,7 +18,8 @@ import argparse
from concurrent.futures._base import TimeoutError from concurrent.futures._base import TimeoutError
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--addr', default='0.0.0.0', help='Address to listen on') # See: host, port in https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.create_server
parser.add_argument('--addr', default='', help='Address to listen on (default: all interfaces, both ipv4 and ipv6)')
parser.add_argument('--port', default=8443, type=int, help='Port to listen on') parser.add_argument('--port', default=8443, type=int, help='Port to listen on')
parser.add_argument('--keepalive-timeout', dest='keepalive_timeout', default=30, type=int, help='Timeout for keepalive (in seconds)') parser.add_argument('--keepalive-timeout', dest='keepalive_timeout', default=30, type=int, help='Timeout for keepalive (in seconds)')
parser.add_argument('--cert-path', default=os.path.dirname(__file__)) parser.add_argument('--cert-path', default=os.path.dirname(__file__))