rancavil / tornado-rest

A simple and useful Restful API for Tornado Web Server
322 stars 93 forks source link

Can it support websocket server #16

Closed leeyisoft closed 5 years ago

leeyisoft commented 5 years ago

I would like to add a hanlder file to the existing restful API to implement a websocket server

I want to share a port with other restful API

The code is as follows. How do I access the websocket server?

urls = [ passport.IndexHandler, websocket.MsgServerHandler,

(r"/websocket", websocket.MsgServerHandler),

]

class MsgServerHandler(tornado.websocket.WebSocketHandler, CommonHandler): current_user_id = '' waiters = {} cache = [] cache_size = 200

rancavil commented 5 years ago

Great...!!!

leeyisoft commented 5 years ago

Could you please merge my last two submissions to master https://github.com/leeyisoft/tornado-rest