
Show HN: Manage web sockets from AWS Lambda using Fanout - jkarneges
https://github.com/fanout/python-faas-grip
======
jkarneges
The chat example is running at ws://58d6587c.fanoutcdn.com/prod/chat if anyone
wants to try it.

E.g. with wscat:

    
    
      wscat -c ws://58d6587c.fanoutcdn.com/prod/chat
      > hello
        < anonymous: hello
    

The backend is here: [https://9h8j7cy642.execute-api.us-
west-1.amazonaws.com/prod/...](https://9h8j7cy642.execute-api.us-
west-1.amazonaws.com/prod/chat)

You can try a direct request to see the backend's response:

    
    
      curl -i -H "Accept: application/websocket-events" -H "Content-Type: application/websocket-events" -d 'OPEN'$'\r'$'\n' https://9h8j7cy642.execute-api.us-west-1.amazonaws.com/prod/chat

------
gtsteve
I hadn't heard of Fanout before. I can't find any info about its global
infrastructure - what regions does it serve?

It might be helpful in the new year. I'm developing a module for my app which
uses websockets but I'm concerned about the performance for our clients in
areas not served by AWS such as the UAE.

~~~
jkarneges
We have servers in SF, London, and Singapore.
[http://status.fanout.io](http://status.fanout.io)

------
candiodari
Interesting approach. We could really use a reverse-proxy-for-websockets
thing.

------
ivan_ah
Nice. The Websockets events as HTTP request response is similar to the
architecture of Django Channels.

~~~
jkarneges
Yup, splitting the session into a series of requests is a good way for Django
Channels to rig things up, especially since Django itself doesn't support
async yet.

We even have a library that works similarly:
[https://github.com/fanout/django-grip](https://github.com/fanout/django-grip)

(goals are different though. maybe someday we'll see ASGI Django apps using
GRIP at the same time :))

