mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-27 05:51:01 +00:00
signalling: Add a flag to hide local Ice candidates
This commit is contained in:
parent
cf176bdd93
commit
e57c2eb101
1 changed files with 9 additions and 0 deletions
|
@ -27,6 +27,7 @@ parser.add_argument('--addr', default='0.0.0.0', help='Address 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('--disable-ssl', default=False, help='Disable ssl', action='store_true')
|
||||
parser.add_argument('--hide-local-candidates', '-hd', default=False, help='Hide local Ice candidates', action='store_true')
|
||||
|
||||
options = parser.parse_args(sys.argv[1:])
|
||||
|
||||
|
@ -150,6 +151,14 @@ async def connection_handler(ws, uid):
|
|||
else:
|
||||
# We're in a session, route message to connected peer
|
||||
msg = json.loads(msg)
|
||||
|
||||
if options.hide_local_candidates:
|
||||
candidate = msg.get("ice", {}).get("candidate")
|
||||
if candidate:
|
||||
if candidate.split()[4].endswith(".local"):
|
||||
logger.info(f"Ignoring local candidate: {candidate}")
|
||||
continue
|
||||
|
||||
other_id = msg['peer-id']
|
||||
try:
|
||||
wso, oaddr, status = peers[other_id]
|
||||
|
|
Loading…
Reference in a new issue