From d751ec44a89302fad7e8c7ff33a5c18c45ad893f 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()