python-websockets / websockets

Library for building WebSocket servers and clients in Python
https://websockets.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
5.23k stars 518 forks source link

Does this library implement redirect? #293

Closed lambdalisue closed 7 years ago

lambdalisue commented 7 years ago

Hello. First of all, thanks for your great plugin. It is really fast and well documented. I really love it.

Btw, RFC 6455 Section 4.2.2.3 said

The server MAY redirect the client using a 3xx status code [RFC2616]. Note that this step can happen together with, before, or after the optional authentication step described above.

But I could not find any documentation about redirection in this library. So I'm wondering if this library support redirection or planning to support.

Thank you.

aaugustin commented 7 years ago

Yes: http://websockets.readthedocs.io/en/stable/api.html#websockets.server.WebSocketServerProtocol.process_request

You can return the appropriate HTTP 3xx from this method when needed.

lambdalisue commented 7 years ago

Thank you!