Thanks alot massimo, i haven't seen that. class PostHandler(tornado.web.RequestHandler): """ only authorized parties can post messages """ def post(self): if hmac_key and not 'signature' in self.request.arguments: return None if 'message' in self.request.arguments: message = self.request.arguments['message'][0] group = self.request. arguments.get('group', ['default'])[0] print '%s:MESSAGE to %s:%s' % (time. time(), group, message) if hmac_key: signature = self.request.arguments[ 'signature'][0] if not hmac.new(hmac_key, message).hexdigest() == signature: return None for client in listeners.get(group, []): client.write_message( message) return None
Very useful! On Thu, Aug 14, 2014 at 11:41 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Did you see this: > > > https://github.com/web2py/web2py/blob/master/gluon/contrib/websocket_messaging.py > > > On Thursday, 14 August 2014 09:18:41 UTC-5, Phyo Arkar wrote: >> >> In our new application , it will be interactive Chat + Social >> Media/News/Forum discussion. >> For most interactive part it will be done in Tornado , but for Non >> Interactive parts (Registration , Auth) I am going to use Web2py. >> Database will be Mongodb. >> We've used web2py extensively for past 5 years. But for interactive part >> Tornado is needed due to Long Polling and Websocket requirements. >> >> Here are my Thoughts: >> >> Home, Registration , Login = Web2py >> Interactive discussion = Tornado >> It will run on openshift with 3 instances. >> >> 1st Gear: uwsgi + web2py >> 2nd Gear: pypy + tornado >> 3rd Gear: Mongodb >> >> >> Both will use Mongodb for database access. >> What i wanted to know is: >> >> I read about We2pyCAS with PHP , had anyone tried using Web2pyCAS for >> Tornado's Apps? >> Can CAS Work well with Mongodb? ( I think it won't as theres no join for >> Mongodb). >> >> >> >> >> -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.