Skip to content

Commit a9272cf

Browse files
committed
parametize the port we listen on for websockets
1 parent 58206d4 commit a9272cf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/selkies/selkies.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
TARGET_VIDEO_BITRATE_KBPS = 16000
1818
MIN_VIDEO_BITRATE_KBPS = 500
1919

20-
DATA_WEBSOCKET_PORT = 8082
2120
UINPUT_MOUSE_SOCKET = ""
2221
JS_SOCKET_PATH = "/tmp"
2322
ENABLE_CLIPBOARD = True
@@ -3268,6 +3267,12 @@ async def main():
32683267
type=int,
32693268
help="Watermark location enum (0-6). Defaults to 4 (Bottom Right) if path is set and this is not specified or invalid.",
32703269
)
3270+
parser.add_argument(
3271+
"--port",
3272+
default=os.environ.get("CUSTOM_WS_PORT", "8082"),
3273+
type=int,
3274+
help="The port for the data websocket server. Overrides the CUSTOM_WS_PORT environment variable.",
3275+
)
32713276
parser.add_argument("--debug", action="store_true", help="Enable debug logging")
32723277
args, unknown = parser.parse_known_args()
32733278
global TARGET_FRAMERATE, TARGET_VIDEO_BITRATE_KBPS
@@ -3304,7 +3309,7 @@ async def main():
33043309
)
33053310

33063311
data_server = DataStreamingServer(
3307-
port=DATA_WEBSOCKET_PORT,
3312+
port=args.port,
33083313
app=app,
33093314
uinput_mouse_socket=UINPUT_MOUSE_SOCKET,
33103315
js_socket_path=JS_SOCKET_PATH,

0 commit comments

Comments
 (0)