How to use the websockify.websocket.WebSocketServer.__init__ function in websockify

To help you get started, we’ve selected a few websockify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jamesacampbell / python-examples / websockify-example.py View on Github external
"rebind.so not found, perhaps you need to run make")
            self.rebinder = os.path.abspath(self.rebinder)

            self.target_host = "127.0.0.1"  # Loopback
            # Find a free high port
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            sock.bind(('', 0))
            self.target_port = sock.getsockname()[1]
            sock.close()

            os.environ.update({
                "LD_PRELOAD": self.rebinder,
                "REBIND_OLD_PORT": str(kwargs['listen_port']),
                "REBIND_NEW_PORT": str(self.target_port)})

        websocket.WebSocketServer.__init__(
            self, RequestHandlerClass, *args, **kwargs)
github emscripten-core / emscripten / third_party / websockify / websockify / websocketproxy.py View on Github external
raise Exception("rebind.so not found, perhaps you need to run make")
            self.rebinder = os.path.abspath(self.rebinder)

            self.target_host = "127.0.0.1"  # Loopback
            # Find a free high port
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            sock.bind(('', 0))
            self.target_port = sock.getsockname()[1]
            sock.close()

            os.environ.update({
                "LD_PRELOAD": self.rebinder,
                "REBIND_OLD_PORT": str(kwargs['listen_port']),
                "REBIND_NEW_PORT": str(self.target_port)})

        websocket.WebSocketServer.__init__(self, RequestHandlerClass, *args, **kwargs)
github BioDepot / BioDepot-workflow-builder / noVNC / utils / websockify / websockify / websocketproxy.py View on Github external
self.target_host = "127.0.0.1"  # Loopback
            # Find a free high port
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            sock.bind(("", 0))
            self.target_port = sock.getsockname()[1]
            sock.close()

            os.environ.update(
                {
                    "LD_PRELOAD": self.rebinder,
                    "REBIND_OLD_PORT": str(kwargs["listen_port"]),
                    "REBIND_NEW_PORT": str(self.target_port),
                }
            )

        websocket.WebSocketServer.__init__(self, RequestHandlerClass, *args, **kwargs)