Questions tagged [haskell-warp]

A Haskell high-performance HTTP server that implements the WAI protocol

warp is a Haskell high-performance HTTP server that implements the WAI protocol.

Being developed by the same authors as Yesod, it is optimized for high performance and low overhead, being interoperable with many other frameworks.

58 questions
0
votes
1 answer

WAI tutorial - no instance for (Show Response)

Again the n00b here: trying Warp and WAI with the following code as in the documentation. {-# LANGUAGE OverloadedStrings, DeriveGeneric #-} import Network.Wai import Network.HTTP.Types import Network.Wai.Handler.Warp (run) app3 :: Application app3…
Madderote
  • 1,107
  • 10
  • 19
0
votes
1 answer

Re-evaluate constants at runtime in Haskell

I am fetching this JSON use it for some computations and want to return a result, using warp as well. Now getJSON is obviously not mutable and won't change at all. How can I re-evaluate getJSON on every http request? What is the cleanest way? …
SparklingWater
  • 358
  • 4
  • 15
0
votes
1 answer

How do I force warp to use a status code other than 200 when using ResponseFile?

When trying to produce a custom 404 error, I attempt to respond with responseFile notFound404 [("Content-Type","text/html")] "404.html" Nothing. However, if "404.html" is present in my filesystem, Warp sends the data with status code 200. Is this…
Tesseract
  • 526
  • 3
  • 20
0
votes
1 answer

Force Yesod to use newer version of Warp

I installed Yesod using Stack. It currently uses Warp v3.2.11.1, but I want it to use the latest version available on GitHub (it hasn't been released yet). I added the following to my stack.yaml file: packages: - '.' - location: git:…
Michał Perłakowski
  • 88,409
  • 26
  • 156
  • 177
0
votes
2 answers

Remove the Server response header in Yesod/Warp

How can I remove the Server HTTP response header in Yesod? I found code that's responsible for setting that header, but I don't know what to do next. I know that I can replace the header value with an empty string by using addHeader "Server" "", but…
Michał Perłakowski
  • 88,409
  • 26
  • 156
  • 177
0
votes
1 answer

Stream stdin to a Wai.EventSource

I would like to stream stdin over an HTTP connection using text/event-stream. The Network.Wai.EventSource thing looks like a good candidate. I tried using this code: import Network.Wai import Network.Wai.EventSource import…
RichardTowers
  • 4,682
  • 1
  • 26
  • 43
0
votes
1 answer

How to redirect requests from domain.com to www.domain in Wai/Warp app?

My site is built in Haskell/Servant and Wai/Warp. I need to redirect all requests from my domain.com to www.domain.com with the the 301 or 302 status. I know I can do that with the help of Wai/Warp somehow. How exactly? startApp :: IO () startApp =…
Jushiti
  • 165
  • 1
  • 10
0
votes
1 answer

Error "empty certificate chain" in a basic haskell app

I generated a certificate in the directory of my Haskell app: openssl genrsa -out key.pem 2048 openssl req -new -key key.pem -out certificate.csr openssl x509 -req -in certificate.csr -signkey key.pem -out certificate.pem and then I ran my…
Jushiti
  • 165
  • 1
  • 10
0
votes
1 answer

Yesod's wrap needs transformers > 0.2.2 and < 0.4, it conflicts with local version

I created a new yesod project as, yesod init cd lemonstand && cabal sandbox init && cabal install Package dependency resolution fails as, next goal: warp (dependency of lemonstand-0.0.0) rejecting: warp-3.0.12.1, 3.0.12,,,,(conflict: lemonstand =>…
user2879704
0
votes
1 answer

How do you add logic into the following `myApp` haskell function?

I am still trying to understand how haskell syntax works. So, here's a dead simple wai/warp application. {-# LANGUAGE OverloadedStrings #-} import Network.Wai import Network.HTTP.Types (status200) import Network.Wai.Handler.Warp (run) myApp _…
Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167
0
votes
2 answers

Yesod -- devel.hs: connect: does not exist (Connection refused)

I'm moving a web app to a new server and upgrading the project from Yesod 1.2 to 1.4. When I ran yesod devel I got the following error: Starting development server... Starting devel application Devel application launched:…
user3776949
  • 237
  • 2
  • 8
0
votes
1 answer

Application server v/s HTTP server

So I have noticed that the docs for various Application Servers (think Unicorn, Puma for Ruby, Warp for Haskell etc) always mentioned something similar to "it is optimized as an app server.” Typically this is mentioned when describing the standard…
-1
votes
2 answers

Spock or Wai/Warp and HTTPS

I have a Spock web site which must be available via HTTPS. How can I setup it up properly for that? I think it should be the same way as for Wai/Warp, but still there's no information which is up to date.
1 2 3
4