Skip to content

Commit

Permalink
feat(script): add option --websocket_origin
Browse files Browse the repository at this point in the history
  • Loading branch information
nritsche committed Jun 22, 2020
1 parent f0b3ce1 commit 8a32b69
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/bondia-server
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ logger = logging.getLogger("bondia-server")
@click.option(
"-n", "--num_procs", help="Number of processes.", default=1, show_default=True
)
def start(configfile, show, port, num_procs):
@click.option(
"--websocket_origin", help="Public hostnames which may connect to the websocket."
)
def start(configfile, show, port, num_procs, websocket_origin):

# TODO: use caput.config
logging.basicConfig(level=logging.DEBUG)
Expand All @@ -44,6 +47,9 @@ def start(configfile, show, port, num_procs):
config = yaml.safe_load(file)
logger.debug(f"Loaded config: {config}")

if isinstance(websocket_origin, str):
websocket_origin = [websocket_origin]

# Prepare as much as possible in centralized server object
server = BondiaServer.from_config(config)

Expand All @@ -57,6 +63,7 @@ def start(configfile, show, port, num_procs):
show=show,
title="bondia | CHIME Daily Validation",
num_procs=num_procs,
websocket_origin=websocket_origin,
)


Expand Down

0 comments on commit 8a32b69

Please sign in to comment.