diff --git a/websockify/websocketproxy.py b/websockify/websocketproxy.py index 76bb901d..525904e5 100644 --- a/websockify/websocketproxy.py +++ b/websockify/websocketproxy.py @@ -12,7 +12,6 @@ ''' import signal, socket, optparse, time, os, sys, subprocess, logging, errno, ssl -import locale try: from socketserver import ThreadingMixIn except ImportError: @@ -47,15 +46,15 @@ class ProxyRequestHandler(websockifyserver.WebSockifyRequestHandler): < - Client send <. - Client send partial """ - + def send_auth_error(self, ex): self.send_response(ex.code, ex.msg) self.send_header('Content-Type', 'text/html') for name, val in ex.headers.items(): self.send_header(name, val) - + self.end_headers() - + def validate_connection(self): if not self.server.token_plugin: return @@ -84,7 +83,7 @@ def auth_connection(self): except (TypeError, AttributeError, KeyError): # not a SSL connection or client presented no certificate with valid data pass - + try: self.server.auth_plugin.authenticate( headers=self.headers, target_host=self.server.target_host, @@ -434,7 +433,7 @@ def select_ssl_version(version): # It so happens that version names sorted lexicographically form a list # from the least to the most secure keys = list(SSL_OPTIONS.keys()) - keys.sort() + keys.sort() fallback = keys[-1] logger = logging.getLogger(WebSocketProxy.log_prefix) logger.warn("TLS version %s unsupported. Falling back to %s", @@ -443,9 +442,6 @@ def select_ssl_version(version): return SSL_OPTIONS[fallback] def websockify_init(): - # Get an unified locale so that we can avoid shipping tons of locales - # if we build a frozen distribution - locale.setlocale(locale.LC_ALL, 'C') # Setup basic logging to stderr. logger = logging.getLogger(WebSocketProxy.log_prefix) logger.propagate = False