diff --git a/bin/websockify b/bin/websockify index 9c8e4fa..0026882 100755 --- a/bin/websockify +++ b/bin/websockify @@ -37,6 +37,8 @@ def websockify_init(): help="SSL certificate file") parser.add_option("--key", default=None, help="SSL key file (if separate from cert)") + parser.add_option("--rebind_path", default="./", + help="Directory containing rebind.so") parser.add_option("--ssl-only", action="store_true", help="disallow non-encrypted connections") parser.add_option("--web", default=None, metavar="DIR", diff --git a/setup.py b/setup.py index 095c653..43a0f0b 100644 --- a/setup.py +++ b/setup.py @@ -22,9 +22,5 @@ setup(name=name, include_package_data=True, install_requires=['numpy'], zip_safe=False, - entry_points={ - 'console_scripts': [ - 'websockify = websockify:websockify_init', - ] - }, + scripts=['bin/websockify'], ) diff --git a/websockify/proxy.py b/websockify/proxy.py index cd83709..5da4efb 100644 --- a/websockify/proxy.py +++ b/websockify/proxy.py @@ -43,16 +43,19 @@ Traffic Legend: self.target_port = kwargs.pop('target_port') self.wrap_cmd = kwargs.pop('wrap_cmd') self.wrap_mode = kwargs.pop('wrap_mode') + self.rebind_path = kwargs.pop('rebind_path') # Last 3 timestamps command was run self.wrap_times = [0, 0, 0] if self.wrap_cmd: - rebinder_path = ['./', os.path.dirname(sys.argv[0]), 'rebind/'] + rebinder_path = [self.rebind_path, + self.rebind_path + '/rebind.so', + './rebind.so', + os.path.dirname(sys.argv[0]) + 'rebind.so', + 'rebind/rebind.so'] self.rebinder = None - for rdir in rebinder_path: - rpath = os.path.join(rdir, "rebind.so") - print rpath + for rpath in rebinder_path: if os.path.exists(rpath): self.rebinder = rpath break