[Tornado] Using Webscoket is always 403 error

Source: Internet
Author: User
Tags response code

The tornado version used is 4.0 +
Backstage: PS d:\codehouse\tornado\websocket> python. \ws_app.pywarning:tornado.access:403 get/ws (:: 1) 1.00msWARNING: tornado.access:403 Get/ws (:: 1) 1.00ms
Front Desk: WebSocket connection to ' Ws://localhost:8080/ws ' failed:error during WebSocket handshake:unexpected response code:40 3


Modification method: The method of overriding homology checking for websocket processing classes:
Class Websockethandler (Tornado.websocket.WebSocketHandler):    def check_origin (Self, origin):        return True    ....

This is said to be a new feature added after the Tornado 4.0 release.

This article is from the "Orangleliu Notebook" blog, reproduced please be sure to keep this source http://blog.csdn.net/orangleliu/article/details/42008423

Author Orangleliu using Attribution-NonCommercial-sharing protocol in the same way

[Tornado] Using Webscoket is always 403 error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.