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.
This commit is contained in:
Pierre Ossman 2019-04-02 17:02:08 +02:00
parent 6e09ec2548
commit d751ec44a8
1 changed files with 2 additions and 1 deletions

3
run
View File

@ -2,4 +2,5 @@
import websockify
websockify.websocketproxy.websockify_init()
if __name__ == '__main__':
websockify.websocketproxy.websockify_init()