Skip to content

Commit

Permalink
note on cors support for sanic
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed May 19, 2019
1 parent 03ce5c9 commit a3a4cb8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,18 @@ The Sanic application is then executed in the usual manner::
if __name__ == '__main__':
app.run()

It has been reported that the CORS support provided by the Sanic extension
`sanic-cors <https://github.com/ashleysommer/sanic-cors>`_ is incomaptible with
this package's own support for this protocol. To disable CORS support in this
package and let Sanic take full control, initialize the server as follows::

eio = engineio.AsyncServer(async_mode='sanic', cors_allowed_origins=[])

On the Sanic side you will need to enable the `CORS_SUPPORTS_CREDENTIALS`
setting in addition to any other configuration that you use::

app.config['CORS_SUPPORTS_CREDENTIALS'] = True

Uvicorn, Daphne, and other ASGI servers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit a3a4cb8

Please sign in to comment.