From 1df95370867f4a065d119a25d1231187a8ade0c5 Mon Sep 17 00:00:00 2001 From: Grant Viklund Date: Mon, 3 Jun 2019 13:37:48 -0700 Subject: [PATCH] Trying redirect for the websocket. --- reacttools/views.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/reacttools/views.py b/reacttools/views.py index aab6a6c..841fb3d 100644 --- a/reacttools/views.py +++ b/reacttools/views.py @@ -160,12 +160,13 @@ def proxy(request, path): # print(request.META) - if request.META.get('HTTP_UPGRADE', '').lower() == 'websocket': - return http.HttpResponse( - content="WebSocket connections aren't supported", - status=501, - reason="Not Implemented" - ) + if request.META.get('HTTP_UPGRADE', '').lower() == 'websocket': # REDIRECT TO NODE SERVER + # return http.HttpResponse( + # content="WebSocket connections aren't supported", + # status=501, + # reason="Not Implemented" + # ) + return http.HttpResponseRedirect(REACT_DEV_SERVER + path) # This might work elif content_type == 'text/html; charset=UTF-8': result = http.HttpResponse(