├── wai-app-static ├── README ├── test │ ├── a │ │ └── b │ └── EmbeddedTestEntries.hs ├── .gitignore ├── קרררר.html ├── .ghci ├── images │ ├── folder.png │ └── haskell.png ├── Setup.lhs ├── README.md ├── app │ └── warp-static.hs ├── tests.hs ├── WaiAppStatic │ └── Storage │ │ └── Embedded.hs ├── embedded-sample.hs ├── sample.hs ├── LICENSE ├── Util.hs └── ChangeLog.md ├── wai ├── README.lhs ├── test │ └── Spec.hs ├── Setup.lhs ├── .ghci ├── webkit-sample │ ├── index.html │ └── webkit-sample.hs ├── LICENSE ├── wai.cabal └── ChangeLog.md ├── warp-tls ├── pong.txt ├── Setup.lhs ├── README.md ├── certificate.pem ├── key.pem ├── LICENSE └── warp-tls.cabal ├── warp ├── attic │ ├── pong.txt │ ├── hex │ ├── test.txt │ ├── file-nolen.hs │ ├── file.hs │ ├── undrained.hs │ ├── statuses.hs │ ├── print-post.hs │ ├── bigtable-single.hs │ ├── bigtable-stream.hs │ ├── server-no-keepalive.hs │ ├── runtests.hs │ └── pong.hs ├── test │ ├── head-response │ ├── Spec.hs │ ├── doctests.hs │ ├── PackIntSpec.hs │ ├── FdCacheSpec.hs │ ├── ReadIntSpec.hs │ ├── HTTP.hs │ ├── ResponseHeaderSpec.hs │ ├── inputFile │ ├── WithApplicationSpec.hs │ ├── ConduitSpec.hs │ └── ExceptionSpec.hs ├── .ghci ├── Setup.lhs ├── README.md ├── Network │ └── Wai │ │ └── Handler │ │ └── Warp │ │ ├── Windows.hs │ │ ├── HTTP2 │ │ ├── File.hs │ │ ├── PushPromise.hs │ │ └── Types.hs │ │ ├── Imports.hs │ │ ├── Counter.hs │ │ ├── ReadInt.hs │ │ ├── HashMap.hs │ │ ├── Date.hs │ │ ├── PackInt.hs │ │ ├── Buffer.hs │ │ ├── IO.hs │ │ └── ResponseHeader.hs └── LICENSE ├── wai-extra ├── test │ ├── json.gz │ ├── noprecompress │ ├── json │ ├── Spec.hs │ ├── requests │ │ └── dalvik-request │ ├── test.html │ ├── sample.hs │ └── Network │ │ └── Wai │ │ └── Middleware │ │ ├── ApprootSpec.hs │ │ ├── RoutedSpec.hs │ │ ├── TimeoutSpec.hs │ │ ├── ForceSSLSpec.hs │ │ └── StripHeadersSpec.hs ├── .gitignore ├── .ghci ├── Setup.lhs ├── README.md ├── example │ ├── index.html │ └── Main.hs ├── Network │ └── Wai │ │ ├── Middleware │ │ ├── Autohead.hs │ │ ├── AddHeaders.hs │ │ ├── MethodOverride.hs │ │ ├── Local.hs │ │ ├── RequestLogger │ │ │ └── Internal.hs │ │ ├── Timeout.hs │ │ ├── AcceptOverride.hs │ │ ├── HealthCheckEndpoint.hs │ │ ├── CleanPath.hs │ │ ├── ForceSSL.hs │ │ ├── Routed.hs │ │ ├── StreamFile.hs │ │ ├── Vhost.hs │ │ ├── ForceDomain.hs │ │ ├── StripHeaders.hs │ │ └── MethodOverridePost.hs │ │ ├── Util.hs │ │ ├── Test │ │ └── Internal.hs │ │ ├── EventSource │ │ └── EventStream.hs │ │ └── EventSource.hs ├── proxy.hs └── LICENSE ├── wai-frontend-monadcgi ├── .gitignore ├── samples │ ├── plain_cgi.hs │ ├── .htaccess │ ├── wai_fastcgi.hs │ ├── wai_cgi.hs │ └── wai_cgi_generic.hs ├── Setup.lhs ├── ChangeLog.md ├── README.md ├── wai-frontend-monadcgi.cabal ├── LICENSE └── Network │ └── Wai │ └── Frontend │ └── MonadCGI.hs ├── recv ├── test │ ├── Spec.hs │ └── BufferPoolSpec.hs ├── ChangeLog.md ├── Network │ └── Socket │ │ ├── BufferPool │ │ ├── Types.hs │ │ └── Buffer.hs │ │ └── BufferPool.hs ├── LICENSE └── recv.cabal ├── auto-update ├── test │ ├── Spec.hs │ └── Control │ │ ├── AutoUpdateSpec.hs │ │ └── ReaperSpec.hs ├── Setup.hs ├── Control │ ├── AutoUpdate │ │ ├── Internal.hs │ │ └── Types.hs │ ├── Reaper │ │ └── Internal.hs │ ├── Debounce.hs │ └── AutoUpdate.hs ├── README.md ├── LICENSE ├── auto-update.cabal └── ChangeLog.md ├── warp-quic ├── Setup.hs ├── ChangeLog.md ├── warp-quic.cabal ├── LICENSE └── Network │ └── Wai │ └── Handler │ └── WarpQUIC.hs ├── wai-conduit ├── Setup.hs ├── ChangeLog.md ├── README.md ├── example │ └── Main.hs ├── wai-conduit.cabal ├── LICENSE └── Network │ └── Wai │ └── Conduit.hs ├── mime-types ├── README.md ├── Setup.lhs ├── mime-types.cabal ├── LICENSE └── ChangeLog.md ├── wai-websockets ├── README.md ├── Setup.lhs ├── ChangeLog.md ├── LICENSE ├── static │ ├── screen.css │ ├── client.html │ └── client.js └── wai-websockets.cabal ├── .gitignore ├── cabal.project ├── wai-http2-extra ├── test │ └── doctests.hs ├── Network │ └── Wai │ │ └── Middleware │ │ └── Push │ │ └── Referer │ │ ├── Multi.hs │ │ ├── LimitMultiMap.hs │ │ ├── Manager.hs │ │ ├── LRU.hs │ │ └── Types.hs ├── LICENSE └── wai-http2-extra.cabal ├── .github ├── PULL_REQUEST_TEMPLATE.md └── ISSUE_TEMPLATE.md ├── stack.yaml ├── README.md ├── stack-nightly.yaml ├── stack-lts-22.yaml ├── time-manager ├── time-manager.cabal ├── LICENSE └── ChangeLog.md ├── LICENSE ├── stack-lts-21.yaml ├── stack-lts-20.yaml ├── fourmolu.yaml └── hie.yaml /wai-app-static/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /wai-app-static/test/a/b: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /wai/README.lhs: -------------------------------------------------------------------------------- 1 | README.md -------------------------------------------------------------------------------- /warp-tls/pong.txt: -------------------------------------------------------------------------------- 1 | PONG -------------------------------------------------------------------------------- /warp/attic/pong.txt: -------------------------------------------------------------------------------- 1 | PONG -------------------------------------------------------------------------------- /wai-extra/test/json.gz: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /warp/attic/hex: -------------------------------------------------------------------------------- 1 | 0123456789abcdef -------------------------------------------------------------------------------- /wai-extra/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | dist 3 | -------------------------------------------------------------------------------- /warp/attic/test.txt: -------------------------------------------------------------------------------- 1 | This is a test. 2 | -------------------------------------------------------------------------------- /wai-extra/test/noprecompress: -------------------------------------------------------------------------------- 1 | noprecompress 2 | -------------------------------------------------------------------------------- /warp/test/head-response: -------------------------------------------------------------------------------- 1 | This is the body 2 | -------------------------------------------------------------------------------- /wai-app-static/.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | cabal-dev 3 | -------------------------------------------------------------------------------- /wai-app-static/קרררר.html: -------------------------------------------------------------------------------- 1 |
It works
9 |Here's some Unicode stuff: שלום
10 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wai-websockets/ChangeLog.md: -------------------------------------------------------------------------------- 1 | ## 3.0.1.3 2 | 3 | * Drop unused dependency on `network` 4 | 5 | ## 3.0.1.2 6 | 7 | * Drop unused dependency on `blaze-builder` 8 | 9 | ## 3.0.1.1 10 | 11 | * Doc improvement 12 | 13 | ## 3.0.1 14 | 15 | * Improved connection close logic 16 | 17 | ## 3.0.0.9 18 | 19 | * Clean up stream resources when websockets completes [#549](https://github.com/yesodweb/wai/pull/549) 20 | 21 | ## 3.0.0.8 22 | 23 | * Support `wai-3.2` 24 | 25 | ## 3.0.0.7 26 | 27 | * Improved documentation [#471](https://github.com/yesodweb/wai/pull/471) 28 | 29 | ## 3.0.0.5 30 | 31 | Allow `blaze-builder-0.4` 32 | -------------------------------------------------------------------------------- /warp/attic/statuses.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedStrings #-} 2 | 3 | import qualified Data.ByteString.Char8 as S 4 | import Data.ByteString.Lazy.Char8 (pack) 5 | import Network.Wai 6 | import Network.Wai.Handler.Warp 7 | 8 | main = run 3000 app 9 | 10 | app req = 11 | return $ 12 | responseLBS (Status s' s) [("Content-Type", "text/plain")] $ 13 | pack $ 14 | concat 15 | [ "The status code is " 16 | , S.unpack s 17 | , ". Have a nice day!" 18 | ] 19 | where 20 | s = S.dropWhile (== '/') $ pathInfo req 21 | s' = read $ S.unpack s 22 | -------------------------------------------------------------------------------- /warp/attic/print-post.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedStrings #-} 2 | 3 | import Blaze.ByteString.Builder (fromByteString) 4 | import Control.Monad.IO.Class (liftIO) 5 | import qualified Data.Conduit as C 6 | import qualified Data.Conduit.List as CL 7 | import Network.HTTP.Types (status200) 8 | import Network.Wai 9 | import Network.Wai.Handler.Warp 10 | 11 | {- 12 | - use `curl -H "Transfer-Encoding: chunked" estfile http://localhost:3000/` to send a chunked post request. 13 | -} 14 | 15 | main = run 3000 app 16 | 17 | app req = do 18 | (requestBody req C.$$ CL.consume) >>= liftIO . print 19 | return $ ResponseBuilder status200 [] (fromByteString "PONG") 20 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Before submitting your PR, check that you've: 2 | 3 | - [ ] Bumped the version number 4 | - [ ] Documented new APIs with [Haddock markup](https://www.haskell.org/haddock/doc/html/index.html) 5 | - [ ] Added [`@since` declarations](http://haskell-haddock.readthedocs.io/en/latest/markup.html#since) to the Haddock 6 | 7 | After submitting your PR: 8 | 9 | - [ ] Update the Changelog.md file with a link to your PR 10 | - [ ] Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts) 11 | 12 | -------------------------------------------------------------------------------- /stack.yaml: -------------------------------------------------------------------------------- 1 | resolver: lts-24.7 2 | packages: 3 | - ./auto-update 4 | - ./mime-types 5 | - ./recv 6 | - ./time-manager 7 | - ./wai 8 | - ./wai-app-static 9 | - ./wai-conduit 10 | - ./wai-extra 11 | - ./wai-frontend-monadcgi 12 | - ./wai-http2-extra 13 | - ./wai-websockets 14 | - ./warp 15 | - ./warp-quic 16 | - ./warp-tls 17 | flags: 18 | wai-extra: 19 | build-example: true 20 | nix: 21 | enable: false 22 | packages: 23 | - fcgi 24 | - zlib 25 | extra-deps: 26 | - ech-config-0.0.1 27 | - hpke-0.0.0 28 | - http-semantics-0.4.0 29 | - http2-5.4.0 30 | - http3-0.1.2 31 | - quic-0.2.21 32 | - random-1.3.1 33 | - sockaddr-0.0.1 34 | - tls-2.1.11 35 | -------------------------------------------------------------------------------- /wai-conduit/example/Main.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | -- stack --resolver lts-11.10 script 3 | 4 | import Conduit 5 | import Control.Monad.Trans.Resource 6 | import Data.ByteString.Builder (byteString) 7 | import Network.HTTP.Types 8 | import Network.Wai 9 | import Network.Wai.Conduit 10 | import Network.Wai.Handler.Warp 11 | 12 | main :: IO () 13 | main = run 3000 app 14 | 15 | app :: Application 16 | app _req respond = 17 | runResourceT $ withInternalState $ \is -> 18 | respond $ 19 | responseSource status200 [] $ 20 | transPipe (`runInternalState` is) (sourceFile "Main.hs") 21 | .| mapC (Chunk . byteString) 22 | -------------------------------------------------------------------------------- /wai-app-static/sample.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedStrings #-} 2 | 3 | import Data.Maybe (mapMaybe) 4 | import Data.String 5 | import Data.Text (pack) 6 | import Network.Wai.Application.Static (defaultFileServerSettings, staticApp) 7 | import Network.Wai.Handler.Warp (defaultSettings, runSettings, settingsPort) 8 | import WaiAppStatic.Types (ssIndices, toPiece) 9 | 10 | main :: IO () 11 | main = 12 | runSettings 13 | defaultSettings 14 | { settingsPort = 3000 15 | } 16 | $ staticApp 17 | (defaultFileServerSettings $ fromString ".") 18 | { ssIndices = mapMaybe (toPiece . pack) ["index.html"] 19 | } 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | An interface between Haskell web frameworks and web servers. 2 | 3 | [](https://github.com/yesodweb/wai/actions/workflows/tests.yml) 4 | 5 | A Haskell web application targets WAI and then can be deployed to any backend with a WAI adaptor. 6 | The premier WAI backend is the Warp web server. 7 | 8 | WAI also adds modularity and code-sharing through middleware and WAI applications. 9 | Code can be written that works with any web framework targeting WAI. 10 | 11 | [Documentation](http://www.yesodweb.com/book/web-application-interface) 12 | 13 | [Haddock Documentation](http://hackage.haskell.org/package/wai) 14 | -------------------------------------------------------------------------------- /wai-frontend-monadcgi/samples/wai_cgi_generic.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PackageImports #-} 2 | 3 | import qualified Network.CGI 4 | import qualified Network.Wai.Frontend.MonadCGI 5 | import qualified Network.Wai.Handler.SimpleServer 6 | import "mtl" Control.Monad.Reader 7 | 8 | main :: IO () 9 | main = 10 | Network.Wai.Handler.SimpleServer.run 3000 $ 11 | Network.Wai.Frontend.MonadCGI.cgiToAppGeneric 12 | monadToIO 13 | mainCGI 14 | 15 | mainCGI :: Network.CGI.CGIT (Reader String) Network.CGI.CGIResult 16 | mainCGI = do 17 | s <- lift ask 18 | Network.CGI.output s 19 | 20 | monadToIO :: Reader String a -> IO a 21 | monadToIO = return . (flip runReader) "This is a generic test" 22 | -------------------------------------------------------------------------------- /auto-update/README.md: -------------------------------------------------------------------------------- 1 | ## auto-update 2 | 3 | A common problem is the desire to have an action run at a scheduled interval, 4 | but only if it is needed. For example, instead of having every web request 5 | result in a new `getCurrentTime` call, we'd like to have a single worker thread 6 | run every second, updating an `IORef`. However, if the request frequency is 7 | less than once per second, this is a pessimization, and worse, kills idle GC. 8 | 9 | This library allows you to define actions which will either be performed by a 10 | dedicated thread or, in times of low volume, will be executed by the calling 11 | thread. 12 | 13 | For original use case, see [yesod-scaffold issue #15](https://github.com/yesodweb/yesod-scaffold/pull/15). 14 | -------------------------------------------------------------------------------- /warp/test/FdCacheSpec.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | module FdCacheSpec where 4 | 5 | import Test.Hspec 6 | #ifndef WINDOWS 7 | import Data.IORef 8 | import Network.Wai.Handler.Warp.FdCache 9 | import System.Posix.IO.ByteString (fdRead) 10 | import System.Posix.Types (Fd(..)) 11 | 12 | main :: IO () 13 | main = hspec spec 14 | 15 | spec :: Spec 16 | spec = describe "withFdCache" $ do 17 | it "clean up Fd" $ do 18 | ref <- newIORef (Fd (-1)) 19 | withFdCache 30000000 $ \getFd -> do 20 | (Just fd,_) <- getFd "warp.cabal" 21 | writeIORef ref fd 22 | nfd <- readIORef ref 23 | fdRead nfd 1 `shouldThrow` anyIOException 24 | #else 25 | spec :: Spec 26 | spec = return () 27 | #endif 28 | -------------------------------------------------------------------------------- /wai-extra/Network/Wai/Middleware/Autohead.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | -- | Automatically produce responses to HEAD requests based on the underlying 4 | -- applications GET response. 5 | module Network.Wai.Middleware.Autohead (autohead) where 6 | 7 | #if __GLASGOW_HASKELL__ < 710 8 | import Data.Monoid (mempty) 9 | #endif 10 | import Network.Wai ( 11 | Middleware, 12 | requestMethod, 13 | responseBuilder, 14 | responseToStream, 15 | ) 16 | 17 | autohead :: Middleware 18 | autohead app req sendResponse 19 | | requestMethod req == "HEAD" = app req{requestMethod = "GET"} $ \res -> do 20 | let (s, hs, _) = responseToStream res 21 | sendResponse $ responseBuilder s hs mempty 22 | | otherwise = app req sendResponse 23 | -------------------------------------------------------------------------------- /wai-extra/Network/Wai/Middleware/AddHeaders.hs: -------------------------------------------------------------------------------- 1 | -- | 2 | -- 3 | -- Since 3.0.3 4 | module Network.Wai.Middleware.AddHeaders ( 5 | addHeaders, 6 | ) where 7 | 8 | import Control.Arrow (first) 9 | import Data.ByteString (ByteString) 10 | import qualified Data.CaseInsensitive as CI 11 | import Network.HTTP.Types (Header) 12 | import Network.Wai (Middleware, mapResponseHeaders, modifyResponse) 13 | import Network.Wai.Internal (Response (..)) 14 | 15 | addHeaders :: [(ByteString, ByteString)] -> Middleware 16 | -- ^ Prepend a list of headers without any checks 17 | -- 18 | -- Since 3.0.3 19 | addHeaders h = modifyResponse $ addHeaders' (map (first CI.mk) h) 20 | 21 | addHeaders' :: [Header] -> Response -> Response 22 | addHeaders' h = mapResponseHeaders (h ++) 23 | -------------------------------------------------------------------------------- /wai-extra/Network/Wai/Middleware/MethodOverride.hs: -------------------------------------------------------------------------------- 1 | module Network.Wai.Middleware.MethodOverride ( 2 | methodOverride, 3 | ) where 4 | 5 | import Control.Monad (join) 6 | import Network.Wai (Middleware, queryString, requestMethod) 7 | 8 | -- | Overriding of HTTP request method via `_method` query string parameter. 9 | -- 10 | -- This middleware only applies when the initial request method is POST. 11 | -- Allows submitting of normal HTML forms, without worries of semantic 12 | -- mismatches with the HTTP spec. 13 | methodOverride :: Middleware 14 | methodOverride app req = 15 | app req' 16 | where 17 | req' = 18 | case (requestMethod req, join $ lookup "_method" $ queryString req) of 19 | ("POST", Just m) -> req{requestMethod = m} 20 | _ -> req 21 | -------------------------------------------------------------------------------- /wai-http2-extra/Network/Wai/Middleware/Push/Referer/Multi.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RecordWildCards #-} 2 | 3 | module Network.Wai.Middleware.Push.Referer.Multi where 4 | 5 | import Data.Set (Set) 6 | import qualified Data.Set as Set 7 | 8 | data Multi a = Multi 9 | { limit :: Int 10 | , list :: [a] 11 | , check :: Set a 12 | } 13 | deriving (Eq, Show) 14 | 15 | empty :: Int -> Multi a 16 | empty n = Multi n [] Set.empty 17 | 18 | singleton :: Int -> a -> Multi a 19 | singleton n v = Multi n [v] $ Set.singleton v 20 | 21 | insert :: Ord a => a -> Multi a -> Multi a 22 | insert _ m@Multi{..} 23 | | Set.size check == limit = m 24 | insert v m@Multi{..} 25 | | Set.size check == Set.size check' = m 26 | | otherwise = Multi limit (v : list) check' 27 | where 28 | check' = Set.insert v check 29 | -------------------------------------------------------------------------------- /stack-nightly.yaml: -------------------------------------------------------------------------------- 1 | resolver: nightly 2 | packages: 3 | - ./auto-update 4 | - ./mime-types 5 | - ./recv 6 | - ./time-manager 7 | - ./wai 8 | - ./wai-app-static 9 | - ./wai-conduit 10 | - ./wai-extra 11 | - ./wai-frontend-monadcgi 12 | - ./wai-http2-extra 13 | - ./wai-websockets 14 | - ./warp 15 | - ./warp-quic 16 | - ./warp-tls 17 | flags: 18 | wai-extra: 19 | build-example: true 20 | nix: 21 | enable: false 22 | packages: 23 | - fcgi 24 | - zlib 25 | extra-deps: 26 | - crypto-token-0.1.2 27 | - crypton-x509-store-1.6.11 28 | - ech-config-0.0.1 29 | - hpke-0.0.0 30 | - http-semantics-0.4.0 31 | - http2-5.4.0 32 | - http3-0.1.2 33 | - network-control-0.1.7 34 | - network-udp-0.0.0 35 | - quic-0.2.21 36 | - random-1.3.1 37 | - tls-2.1.11 38 | - tls-session-manager-0.0.7 39 | - sockaddr-0.0.1 40 | -------------------------------------------------------------------------------- /wai-extra/Network/Wai/Middleware/Local.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | -- | Only allow local connections. 4 | module Network.Wai.Middleware.Local ( 5 | local, 6 | ) where 7 | 8 | import Network.Socket (SockAddr (..)) 9 | import Network.Wai (Middleware, Response, remoteHost) 10 | 11 | -- | This middleware rejects non-local connections with a specific response. 12 | -- It is useful when supporting web-based local applications, which would 13 | -- typically want to reject external connections. 14 | local :: Response -> Middleware 15 | local resp f r k = case remoteHost r of 16 | SockAddrInet _ h 17 | | h == fromIntegral home -> 18 | f r k 19 | #if !defined(mingw32_HOST_OS) && !defined(_WIN32) 20 | SockAddrUnix _ -> f r k 21 | #endif 22 | _ -> k resp 23 | where 24 | home :: Integer 25 | home = 127 + (256 * 256 * 256) 26 | -------------------------------------------------------------------------------- /warp/attic/bigtable-single.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedStrings #-} 2 | 3 | import Blaze.ByteString.Builder (Builder, fromByteString) 4 | import Blaze.ByteString.Builder.Char8 (fromShow) 5 | import Data.Monoid (mappend) 6 | import Network.Wai 7 | import Network.Wai.Handler.Warp (run) 8 | 9 | bigtable :: Builder 10 | bigtable = 11 | fromByteString "Just this same paragraph again. " 20 | , show (i :: Int) 21 | , "
" 22 | ] 23 | ["test.html"] -> ResponseFile status200 [] "test.html" Nothing 24 | ["json"] -> 25 | ResponseFile 26 | status200 27 | [(hContentType, "application/json")] 28 | "json" 29 | Nothing 30 | _ -> ResponseFile status404 [] "../LICENSE" Nothing 31 | 32 | main :: IO () 33 | main = run 3000 $ gzip defaultGzipSettings $ jsonp app 34 | -------------------------------------------------------------------------------- /wai/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /warp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /wai-extra/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /warp-tls/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /mime-types/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /time-manager/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /wai-app-static/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /wai-frontend-monadcgi/wai-frontend-monadcgi.cabal: -------------------------------------------------------------------------------- 1 | name: wai-frontend-monadcgi 2 | version: 3.0.0.3 3 | license: MIT 4 | license-file: LICENSE 5 | author: Michael Snoyman