1

Flask-socketio で、強制的にトランスポートを Web ソケットのみにすることはできますか?

元のプロトコルによると:

https://github.com/socketio/engine.io 
transports (<Array> String): transports to allow connections to (['polling', 'websocket'])

私の目標は、元の HTTP 呼び出しを取り除くことです。

一番、

4

2 に答える 2

0

Flask-SoskcetIO のドキュメントによると、async_mode を使用して async_mode を設定できます。gevent-websocket を使用して eventlet または gevent をインストールした場合、websocket が最初に使用されます。

       async_mode: The asynchronous model to use. See the Deployment
                   section in the documentation for a description of the
                   available options. Valid async modes are
                   ``threading``, ``eventlet``, ``gevent`` and
                   ``gevent_uwsgi``. If this argument is not given,
                   ``eventlet`` is tried first, then ``gevent_uwsgi``,
                   then ``gevent``, and finally ``threading``. The
                   first async mode that has all its dependencies installed
                   is then one that is chosen.
于 2016-12-13T03:40:57.183 に答える