From fb6405bffbddabdbc5aae65a0ae18e1a3e54c0bb Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 2 Apr 2019 17:02:08 +0200 Subject: [PATCH] Allow main script to be imported We should only start the server if we are the main module, and not imported some other way. This is important for multiprocessing to work correctly on Windows. --- run | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run b/run index 9ad217c..9ea6996 100755 --- a/run +++ b/run @@ -2,4 +2,5 @@ import websockify -websockify.websocketproxy.websockify_init() +if __name__ == '__main__': + websockify.websocketproxy.websockify_init()