From ae025cd22bf395a72f9781f45633ea21b2320f4a Mon Sep 17 00:00:00 2001 From: benoitc Date: Mon, 31 May 2010 21:34:50 +0200 Subject: [PATCH] put back websocket support with new http parser --- examples/gevent_websocket.py | 2 +- examples/websocket.py | 2 +- gunicorn/http/wsgi.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) 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,