Skip to content

Commit 1000e30

Browse files
author
Chad Smith
authored
Merge pull request #11 from joelhoro/master
Allow passing in host
2 parents 8e90c41 + ddf8440 commit 1000e30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pyxtermjs/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def main():
9999
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
100100
)
101101
parser.add_argument("-p", "--port", default=5000, help="port to run server on")
102+
parser.add_argument("-h", "--host", default='127.0.0.1', help="host to run server on (use 0.0.0.0 to allow access from other hosts)")
102103
parser.add_argument("--debug", action="store_true", help="debug the server")
103104
parser.add_argument("--version", action="store_true", help="print version and exit")
104105
parser.add_argument(
@@ -115,7 +116,7 @@ def main():
115116
exit(0)
116117
print(f"serving on http://127.0.0.1:{args.port}")
117118
app.config["cmd"] = [args.command] + shlex.split(args.cmd_args)
118-
socketio.run(app, debug=args.debug, port=args.port)
119+
socketio.run(app, debug=args.debug, port=args.port, host=args.host)
119120

120121

121122
if __name__ == "__main__":

0 commit comments

Comments
 (0)