diff --git a/examples/gevent_websocket.py b/examples/gevent_websocket.py index d150df55..dbba9750 100644 --- a/examples/gevent_websocket.py +++ b/examples/gevent_websocket.py @@ -27,7 +27,7 @@ class WebSocketWSGI(object): start_response('400 Bad Request', [('Connection','close')]) return [] - sock = environ['wsgi.input'].get_socket() + sock = environ['gunicorn.socket'] ws = WebSocket(sock, environ.get('HTTP_ORIGIN'), environ.get('HTTP_WEBSOCKET_PROTOCOL'), diff --git a/examples/websocket.py b/examples/websocket.py index e3de91c9..5bef4b28 100644 --- a/examples/websocket.py +++ b/examples/websocket.py @@ -28,7 +28,7 @@ class WebSocketWSGI(object): start_response('400 Bad Request', [('Connection','close')]) return [] - sock = environ['wsgi.input'].get_socket() + sock = environ['gunicorn.socket'] ws = WebSocket(sock, environ.get('HTTP_ORIGIN'), environ.get('HTTP_WEBSOCKET_PROTOCOL'), diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py index 1b640606..758ae502 100644 --- a/gunicorn/http/wsgi.py +++ b/gunicorn/http/wsgi.py @@ -88,6 +88,7 @@ def create(req, sock, client, server, debug=False): "wsgi.multithread": False, "wsgi.multiprocess": wsgi_multiprocess, "wsgi.run_once": False, + "gunicorn.socket": sock, "SCRIPT_NAME": script_name, "SERVER_SOFTWARE": SERVER_VERSION, "REQUEST_METHOD": req.method,