Implementing tornado chat server with web2py

829 views
Skip to first unread message

Saurabh Kumar

unread,
Nov 28, 2011, 2:06:47 PM11/28/11
to web...@googlegroups.com
 Hi,

We are planning to implement an omegle.com like chatting server. We have decided to use webpy for the same. Which out of tornado or twisted framework would be advisable? Is there any other framework especially suitable for this particular application?


Thanks

Saurabh

Massimo Di Pierro

unread,
Nov 28, 2011, 2:55:35 PM11/28/11
to web2py-users
Look into this:

http://code.google.com/p/web2py/source/browse/gluon/contrib/comet_messaging.py

I would go with tornado or gevent. They seems much simpler then
twisted and more in line with the web2py keep-it-simple phylosophy.

Massimo

Anthony

unread,
Nov 28, 2011, 2:57:04 PM11/28/11
to web...@googlegroups.com
Are you aware of comet_messaging.py (http://code.google.com/p/web2py/source/browse/gluon/contrib/comet_messaging.py) -- it uses Tornado? Here's a three part tutorial on using it with Socket.IO for a chat application: http://greg.thehellings.com/2011/04/web2py-websockets-and-socket-io-part-i-basic-display/

Anthony

Saurabh Kumar

unread,
Dec 6, 2011, 4:13:26 AM12/6/11
to web2py-users
Hi,

Thanks for the replies. So we will decide upon tornado or gevent.
One particular concern in our project is to implement the server
efficiently. We want a server that can handle thousands of users
chatting simultaneously. Would a simple code like comet_messaging.py
be that capable or we need to think of some other improvements over
this?

Thanks

Saurabh

On Nov 29, 12:57 am, Anthony <abasta...@gmail.com> wrote:
> Are you aware of comet_messaging.py

> (http://code.google.com/p/web2py/source/browse/gluon/contrib/comet_mes...)


> -- it uses Tornado? Here's a three part tutorial on using it with Socket.IO
> for a chat

> application:http://greg.thehellings.com/2011/04/web2py-websockets-and-socket-io-p...

Massimo Di Pierro

unread,
Dec 6, 2011, 10:59:32 AM12/6/11
to web2py-users
For a chatting server comet_messaging.py is all you need. It already
support groups which you can think of as chat-rooms.

Saurabh Kumar

unread,
Dec 6, 2011, 1:15:27 PM12/6/11
to web2py-users
Thanks again for the reply.
The chat room thing is OK. Instead what I am concerned about is if the
code is efficient enough to handle thousands of request.

Saurabh


On Dec 6, 8:59 pm, Massimo Di Pierro <massimo.dipie...@gmail.com>
wrote:

Anthony Bastardi

unread,
Dec 6, 2011, 1:50:10 PM12/6/11
to web...@googlegroups.com
On Tue, Dec 6, 2011 at 1:15 PM, Saurabh Kumar <saurab...@gmail.com> wrote:
Thanks again for the reply.
The chat room thing is OK. Instead what I am concerned about is if the
code is efficient enough to handle thousands of request.
It should be. That's why Tornado is used -- it is a non-blocking web server. See http://www.tornadoweb.org/.
 
Anthony 

Khalil KHAMLICHI

unread,
Jan 4, 2012, 9:01:04 PM1/4/12
to web...@googlegroups.com
looks like websockets dont work any more with the couple chrome/tornado => error : Unexpected response code: 426
attached image from dev. tools in chrome.



websocket_error_in_newVersion_of_chrome.png

Red Arrow

unread,
Jan 6, 2012, 2:25:58 AM1/6/12
to web2py-users
for chatting, usually use XMPP like Gtalk or facebook chat. If
choosing between gevent or tornado, gevent can handle better than
tornado.
http://nichol.as/benchmark-of-python-web-servers

On 5 Tháng Giêng, 09:01, Khalil KHAMLICHI <khamlichi.kha...@gmail.com>
wrote:
> looks like websockets dont work any more with the couple chrome/tornado =>
> error : Unexpected response code: 426
> attached image from dev. tools in chrome.
>
>  websocket_error_in_newVersion_of_chrome.png
> 21KXemTải xuống

Abhishek Gupta

unread,
Jan 17, 2012, 7:27:14 PM1/17/12
to web...@googlegroups.com
I implemented a similar solution, but the user keeps on getting disconnected from the tornado server. This happens frequently with chrome. Any guesses, so as why the user is being disconnected so often (in every 4-5 secs).

Phyo Arkar

unread,
Jan 19, 2012, 11:23:53 AM1/19/12
to web...@googlegroups.com
Websocket is not ready , it is just a draft protocol. i wont recommend any serious use on it.

dederocks

unread,
Nov 19, 2012, 5:20:17 AM11/19/12
to web...@googlegroups.com
Regarding the error 426 mentionned, I don't know if you tried to use chromium instead of chrome. At least I has the 426 error in chromium, but NOT with chrome. Hope this helps.

Ovidio Marinho

unread,
Nov 19, 2012, 11:05:44 AM11/19/12
to web...@googlegroups.com
look is this http://vimeo.com/38972256
      


       Ovidio Marinho Falcao Neto
                Web Developer
             ovid...@gmail.com 
          ovidio...@itjp.net.br
                 ITJP - itjp.net.br
               83   8826 9088 - Oi
               83   9334 0266 - Claro
                        Brasil
              



2012/11/19 dederocks <dedi...@gmail.com>

--
 
 
 

Reply all
Reply to author
Forward
0 new messages