0

Im having trouble establishing a WebSocket connection between a client and a server (both on localhost).

I'm using Nginx, uWSGI and Flask.

I'm getting the following error printed out in the uWSGI log when I try to establish a WebSocket connection (note that normal GET and POST works):

    you need to build uWSGI with SSL support to use the websocket handshake api function !!!
Traceback (most recent call last):
  File "/Users/user/Documents/Development/virtualenv/flask/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/user/Documents/Development/virtualenv/flask/lib/python2.7/site-packages/flask_uwsgi_websocket/_gevent.py", line 63, in __call__
    environ.get('HTTP_ORIGIN', ''))
IOError: unable to complete websocket handshake

My question is therefore: How can I build uWSGI with SSL support?

Vingtoft
  • 13,368
  • 23
  • 86
  • 135
  • i suspect uwsgi just supports SSL without specifically building that feature. you do need to configure it properly. Did you see [this](http://uwsgi-docs.readthedocs.org/en/latest/HTTPS.html)? – GG_Python Jan 22 '16 at 06:27
  • Show us your application code for WebSocket communication. – GwynBleidD Jan 22 '16 at 08:46
  • Possible duplicate of [how to build uWSGI with SSL support to use the websocket handshake API function?](https://stackoverflow.com/questions/24183053/how-to-build-uwsgi-with-ssl-support-to-use-the-websocket-handshake-api-function) – ibrewster Aug 16 '17 at 19:17
  • Several of the answers to this question: https://stackoverflow.com/questions/24183053/how-to-build-uwsgi-with-ssl-support-to-use-the-websocket-handshake-api-function explain how to do this on macOS X. Personally, I tend to refer to this answer: https://stackoverflow.com/a/38842664/272118 – ibrewster Aug 16 '17 at 19:17

0 Answers0