zostay / RakuWAPI

The Web API for Raku (RakuWAPI)
Artistic License 2.0
24 stars 5 forks source link

Alternate response format for WebSocket? #24

Open zostay opened 9 years ago

zostay commented 9 years ago

So, the 3 element response makes sense for HTTP/1.0 and HTTP/1.1. It mostly makes sense for HTTP/2 as well. It does not make any sense for WebSocket. For those responses, it might be most sensible to just return the Supply and skip the headers. This might be a general note, that the response expected from the Promise depends upon the contents of SERVER_PROTOCOL.

It would be the server's responsibility, then, to detect non-sensical responses to protocol extensions. It might also be a place where we again want to consider some sort of configuration API be layered on to pre-declare which protocols an application actually is able to support.

muraiki commented 8 years ago

You might be interested in how Django is tackling this using channels and ASGI: https://blog.heroku.com/archives/2016/3/17/in_deep_with_django_channels_the_future_of_real_time_apps_in_django