summaryrefslogtreecommitdiff
path: root/run
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2019-04-02 17:02:08 +0200
committerPierre Ossman <ossman@cendio.se>2019-04-02 17:02:08 +0200
commitd751ec44a89302fad7e8c7ff33a5c18c45ad893f (patch)
treeda8ccf383b9281531fcb4d65b9c13a540b363794 /run
parent6e09ec25486f431e2acc463f994c4eb4bebc6ddd (diff)
downloadwebsockify-d751ec44a89302fad7e8c7ff33a5c18c45ad893f.tar.gz
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.
Diffstat (limited to 'run')
-rwxr-xr-xrun3
1 files changed, 2 insertions, 1 deletions
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()