Skip to content

Commit

Permalink
Trying redirect for the websocket.
Browse files Browse the repository at this point in the history
  • Loading branch information
renderbox committed Jun 3, 2019
1 parent 5a572e3 commit 1df9537
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions reacttools/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1df9537

Please sign in to comment.