scotty-tls 0.1.0.0 → 0.3.0.0
raw patch · 3 files changed
+12/−8 lines, 3 filesdep ~scotty
Dependency ranges changed: scotty
Files
- README.md +4/−0
- Web/Scotty/TLS.hs +6/−6
- scotty-tls.cabal +2/−2
README.md view
@@ -2,6 +2,10 @@ You can test by generating a self-signed certificate [here](http://www.akadia.com/services/ssh_test_certificate.html). +```text+cabal update && cabal install scotty-tls+```+ ```haskell {-# LANGUAGE OverloadedStrings #-}
Web/Scotty/TLS.hs view
@@ -12,21 +12,21 @@ import Control.Monad.IO.Class (MonadIO (liftIO)) import Network.Wai (Response) import Network.Wai.Handler.Warp (Port, defaultSettings,- settingsPort)+ setPort) import Network.Wai.Handler.WarpTLS (certFile, defaultTlsSettings, keyFile, runTLS)-import Web.Scotty (scottyApp)-import Web.Scotty.Trans (ScottyM, ScottyT, scottyAppT)+import Web.Scotty (scottyApp, ScottyM)+import Web.Scotty.Trans (ScottyT, scottyAppT) -- | Run a Scotty application over TLS scottyTLS :: Port -> FilePath -> FilePath -> ScottyM () -> IO () scottyTLS port key cert = runTLS (defaultTlsSettings { keyFile = key , certFile = cert })- (defaultSettings { settingsPort = port }) <=< scottyApp+ (setPort port defaultSettings) <=< scottyApp scottyTTLS :: (Monad m, MonadIO n) => Port -> FilePath -> FilePath ->- (forall a. m a -> n a) -> (m Response -> IO Response) -> ScottyT m () -> n ()+ (forall a. m a -> n a) -> (m Response -> IO Response) -> ScottyT t m () -> n () scottyTTLS port key cert runM runToIO s = scottyAppT runM runToIO s >>= liftIO . runTLS (defaultTlsSettings { keyFile = key, certFile = cert })- (defaultSettings { settingsPort = port })+ (setPort port defaultSettings)
scotty-tls.cabal view
@@ -1,5 +1,5 @@ name: scotty-tls-version: 0.1.0.0+version: 0.3.0.0 synopsis: TLS for Scotty description: Run your Scotty apps over TLS homepage: https://github.com/dmjio/scotty-tls.git@@ -17,7 +17,7 @@ exposed-modules: Web.Scotty.TLS other-extensions: RankNTypes build-depends: base >=4.3.1 && < 5,- scotty >=0.5.0,+ scotty >=0.7.0, warp >= 1.3.4.1, warp-tls >=1.4.1.4, wai >= 1.3.0.1,