Renamed CustomProxyServer to WebSocketProxy; this was the earlier name.

Also, call the server instance "server", not "httpd", even when using
LibProxyServer.
This commit is contained in:
Peter Åstrand (astrand) 2013-03-18 13:22:48 +01:00
parent 70eb75a3e6
commit debc926612
1 changed files with 5 additions and 6 deletions

View File

@ -22,7 +22,7 @@ except:
from cgi import parse_qs
from urlparse import urlparse
class CustomProxyServer(websocket.WebSocketServer):
class WebSocketProxy(websocket.WebSocketServer):
"""
Proxy traffic to and from a WebSockets client to a normal TCP
socket server target. All traffic to/from the client is base64
@ -400,17 +400,16 @@ def websockify_init():
del opts.libserver
if libserver:
# Use standard Python SocketServer framework
httpd = LibProxyServer(ProxyRequestHandler, **opts.__dict__)
httpd.serve_forever()
server = LibProxyServer(ProxyRequestHandler, **opts.__dict__)
else:
# Use internal service framework
server = CustomProxyServer(ProxyRequestHandler, **opts.__dict__)
server.start_server()
server = WebSocketProxy(ProxyRequestHandler, **opts.__dict__)
server.start_server()
class LibProxyServer(SocketServer.ForkingMixIn, BaseHTTPServer.HTTPServer):
"""
Just like CustomProxyServer, but uses standard Python SocketServer
Just like WebSocketProxy, but uses standard Python SocketServer
framework.
"""