From f21a7d33a28f250c4bc920588190e2a206232a25 Mon Sep 17 00:00:00 2001 From: Skia Date: Tue, 28 May 2019 10:27:51 +0200 Subject: [PATCH] Add a __main__.py file for invocation as a module This file allows an easy invocation of websockify as a module, which is handy when running into shebang issues (https://github.com/pypa/virtualenv/issues/596). With this patch, `python -m websockify ...` has just the same behavior as `./run ...`. --- websockify/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 websockify/__main__.py diff --git a/websockify/__main__.py b/websockify/__main__.py new file mode 100644 index 0000000..8378d46 --- /dev/null +++ b/websockify/__main__.py @@ -0,0 +1,4 @@ +import websockify + +if __name__ == '__main__': + websockify.websocketproxy.websockify_init()