librelist archives

« back to archive

Websockets

Websockets

From:
bruce bushby
Date:
2011-12-30 @ 13:55
Hi

I know I've asked this before but thought I would ask again in hope
the status has changed or maybe others have had some success.

Does flask work with websockets?

I found this rather informative link....it's got everything I
need.....except for flask :(
http://blog.pythonisito.com/2011/07/gevent-zeromq-websockets-and-flot-ftw.html

Any ideas?

Thanks
Bruce

Re: [flask] Websockets

From:
Max Countryman
Date:
2011-12-30 @ 14:11
Bruce,

Maybe not directly. But check out Juggernaut… I have a demo if you'd like 
to see it in action: http://logger.conceptis.org/ also you've got the code
on GitHub: https://github.com/maxcountryman/logmon

Alternatively, check out gevent-websocket.

HTH,


Max

On Dec 30, 2011, at 8:55 AM, bruce bushby wrote:

> Hi
> 
> I know I've asked this before but thought I would ask again in hope
> the status has changed or maybe others have had some success.
> 
> Does flask work with websockets?
> 
> I found this rather informative link....it's got everything I
> need.....except for flask :(
> http://blog.pythonisito.com/2011/07/gevent-zeromq-websockets-and-flot-ftw.html
> 
> Any ideas?
> 
> Thanks
> Bruce

Re: [flask] Websockets

From:
Armin Ronacher
Date:
2011-12-30 @ 14:33
Hi,

WSGI does not support websockets but various servers have extensions to
handle them.  However most of the time you really only need push
notifications and for that running a separate service like Juggernaut or
outsourcing to pubnub etc. is the better option.


Regards,
Armin

Re: [flask] Websockets

From:
Werner
Date:
2011-12-30 @ 16:37
I haven't used it, but Brubeck[1] looks like a nice way to deal with event
architecture for the web. It uses 0mq to talk to mongrel2 and gevent for 
coroutines.

You can run flask under the gevent WSGIServer but it is an ugly construction.

[1] http://brubeck.io/

Grtz 


On Friday 30 December 2011 at 15:33, Armin Ronacher wrote:

> Hi,
> 
> WSGI does not support websockets but various servers have extensions to
> handle them. However most of the time you really only need push
> notifications and for that running a separate service like Juggernaut or
> outsourcing to pubnub etc. is the better option.
> 
> 
> Regards,
> Armin

Re: [flask] Websockets

From:
Ernesto Menéndez
Date:
2011-12-30 @ 19:42
You can run the websockets service in another port.  Take a look at
ws4py https://github.com/Lawouach/WebSocket-for-Python


2011/12/30 Werner <el.lauwer@gmail.com>:
> I haven't used it, but Brubeck[1] looks like a nice way to deal with event
> architecture for the web. It uses 0mq to talk to mongrel2 and gevent for
> coroutines.
>
> You can run flask under the gevent WSGIServer but it is an ugly
> construction.
>
> [1] http://brubeck.io/
>
> Grtz
>
> On Friday 30 December 2011 at 15:33, Armin Ronacher wrote:
>
> Hi,
>
> WSGI does not support websockets but various servers have extensions to
> handle them. However most of the time you really only need push
> notifications and for that running a separate service like Juggernaut or
> outsourcing to pubnub etc. is the better option.
>
>
> Regards,
> Armin
>
>

Re: [flask] Websockets

From:
Cheng-Han Lee
Date:
2011-12-31 @ 00:26
Pusher is also another alternative if you are looking for a websocket
sass provider. Pusher has a free, micro plan that allows you to try
out their service.

http://pusher.com

2011/12/30 Ernesto Menéndez <pyalec@gmail.com>:
> You can run the websockets service in another port.  Take a look at
> ws4py https://github.com/Lawouach/WebSocket-for-Python
>
>
> 2011/12/30 Werner <el.lauwer@gmail.com>:
>> I haven't used it, but Brubeck[1] looks like a nice way to deal with event
>> architecture for the web. It uses 0mq to talk to mongrel2 and gevent for
>> coroutines.
>>
>> You can run flask under the gevent WSGIServer but it is an ugly
>> construction.
>>
>> [1] http://brubeck.io/
>>
>> Grtz
>>
>> On Friday 30 December 2011 at 15:33, Armin Ronacher wrote:
>>
>> Hi,
>>
>> WSGI does not support websockets but various servers have extensions to
>> handle them. However most of the time you really only need push
>> notifications and for that running a separate service like Juggernaut or
>> outsourcing to pubnub etc. is the better option.
>>
>>
>> Regards,
>> Armin
>>
>>

Integration with CAS?

From:
Abdul Bijur Vallarkodath
Date:
2012-01-05 @ 23:32
Dear folks,

Have anyone tried integrating a flask app with CAS? http://jasig.org/cas 
(FSF uses CAS for authentication)

This will completely hand-over all session management etc. to CAS and we 
will have to manage only a SAML or similar call to CAS to authenticate.

possible pblm: CAS runs on tomcat.

Abdul

Re: [flask] Integration with CAS?

From:
Simon Sapin
Date:
2012-01-06 @ 07:07
Le 06/01/2012 00:32, Abdul Bijur Vallarkodath a écrit :
> Dear folks,
>
> Have anyone tried integrating a flask app with CAS?http://jasig.org/cas
> (FSF uses CAS for authentication)
>
> This will completely hand-over all session management etc. to CAS and we
> will have to manage only a SAML or similar call to CAS to authenticate.
>
> possible pblm: CAS runs on tomcat.

Hi,

It looks like CAS has client libraries in several languages, separated 
from the server. So the server running on tomcat is not a problem.

http://www.jasig.org/cas/client-integration

The thing is there is not official python client. Google shows some 
unofficial clients. One could write a Flask extension to integrate a 
client with Flask sessions.

Regards,
-- 
Simon Sapin

Re: [flask] Integration with CAS?

From:
Abdul Bijur Vallarkodath
Date:
2012-01-06 @ 10:45
 From this page: https://wiki.jasig.org/display/CASC/Pycas

    |import| |pycas|
    |CAS_SERVER  = ||"https://casserver.mydomain"
    <https://casserver.mydomain>|
    |SERVICE_URL = ||"http://webserver.mydomain/cgi-bin/webapp.py"
    <http://webserver.mydomain/cgi-bin/webapp.py>|
    |status, id, cookie = login(CAS_SERVER, SERVICE_URL)|
    ||

|
The site could do this once and check sessions.

|

    *status* carries the success or failure status.
    *id* is the user's account name.
    *cookie* is the header string to send to the client if it's not empty.


This should work well.

Regards,
Abdul



On 1/6/12 8:07 AM, Simon Sapin wrote:
> Le 06/01/2012 00:32, Abdul Bijur Vallarkodath a écrit :
>> Dear folks,
>>
>> Have anyone tried integrating a flask app with CAS?http://jasig.org/cas
>> (FSF uses CAS for authentication)
>>
>> This will completely hand-over all session management etc. to CAS and we
>> will have to manage only a SAML or similar call to CAS to authenticate.
>>
>> possible pblm: CAS runs on tomcat.
> Hi,
>
> It looks like CAS has client libraries in several languages, separated
> from the server. So the server running on tomcat is not a problem.
>
> http://www.jasig.org/cas/client-integration
>
> The thing is there is not official python client. Google shows some
> unofficial clients. One could write a Flask extension to integrate a
> client with Flask sessions.
>
> Regards,