-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wai-eventsource integration (turn a wai Application into ActionT) #80
Comments
Ah I can implement this. I'm not near a computer right now, but soon. Thanks for reporting! |
I think the most promising way to fix this issue is to make ScottyResponse more general: data ScottyResponse = SR
{ srStatus :: Status
, srHeaders :: ResponseHeaders -- ^ additional headers to append to the srResponse
, srResponse :: Network.Wai.Response
} I guess it is possible to keep existing API the same. Do you have some considerations against this changes or any better ideas? |
I've been looking at websockets and Scotty and my current solution is to handle websockets outside the Scotty app. It's not elegant but it works. |
What's the status on that? I wrote a simple handler to test how that could be done:
And it works, but drops the connection nevertheless. |
Any progress on this issue? |
Why does this drop the connection despite having the keep-alive header? |
Well, now (since #233) you can have |
The problem I've encountered is that it's impossible to turn a wai
Application
intoActionT
. Examples when we might need this includes bothwai-eventsource
andwai-websockets
enabled applications, but lets consider the first one for a moment:where
application
function is impossible to implement becauseScottyResponse
do not allow to return a plain old waiResponse
. The workaround is to set middleware with interceptor routing, which is pretty awkward.The text was updated successfully, but these errors were encountered: