Comments (7)
Any progress on this issue?
from scotty.
Well, now (since #233) you can have nested
wai Applications under a Scotty route!
from scotty.
Ah I can implement this. I'm not near a computer right now, but soon. Thanks for reporting!
from scotty.
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?
from scotty.
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.
from scotty.
What's the status on that? I wrote a simple handler to test how that could be done:
sse :: T.Text -> ActionM ()
sse t = do
setCorsHeader
setHeader "Content-Type" "text/event-stream"
setHeader "Cache-Control" "no-cache"
setHeader "Connection" "keep-alive"
raw $ encodeUtf8 t
And it works, but drops the connection nevertheless.
from scotty.
What's the status on that? I wrote a simple handler to test how that could be done:
sse :: T.Text -> ActionM () sse t = do setCorsHeader setHeader "Content-Type" "text/event-stream" setHeader "Cache-Control" "no-cache" setHeader "Connection" "keep-alive" raw $ encodeUtf8 t
And it works, but drops the connection nevertheless.
Why does this drop the connection despite having the keep-alive header?
from scotty.
Related Issues (20)
- Development server for scotty
- Release 0.21
- 'status' and 'raiseStatus' (and 'redirect') overlap in functionality HOT 5
- Add test for 'defaultHandler unsets actionErrorHandler'
- Reimplement `ScottyT` in terms of ReaderT HOT 5
- Add usage examples at the top of the user-facing modules
- Is MonadReader ActionEnv (ActionT m) a good idea? HOT 1
- The name captureParam is a bit strange HOT 1
- doesn't compile against ghc 9.6.3 seems to need a version bump HOT 4
- Not able to rewrite the query string using Network.Wai.Middleware.Rewrite HOT 5
- [RFC] OpenAPI interop
- Expose Cookie via the main interface HOT 1
- Add doctest
- Variable not in scope: pathParam In examples/basic.hs file HOT 3
- Establish API deprecation and cleanup policy
- SQLite module HOT 2
- Accept text-2.1 HOT 1
- Update README with Stackage badges
- Undocumented change to the `File` type definition HOT 1
- Dependency upper bounds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scotty.