]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - examples/SSL.hs
use time-http 0.5
[Lucu.git] / examples / SSL.hs
index aa8b3a596ffa29031eb136d5b7587976c4ac3f0e..cbf75dc8aa4bd46fb8ef4ca9ce7de588d39cd666 100644 (file)
@@ -9,6 +9,7 @@ import Control.Monad.IO.Class
 import Control.Monad.Unicode
 import qualified Data.ByteString.Lazy.Char8 as Lazy
 import qualified Data.Collections as C
+import Data.Default
 import Data.Time.Clock
 import Network
 import Network.HTTP.Lucu
@@ -17,6 +18,7 @@ import OpenSSL.EVP.PKey
 import OpenSSL.RSA
 import qualified OpenSSL.Session as SSL
 import OpenSSL.X509
+import Prelude.Unicode
 
 main ∷ IO ()
 main = withOpenSSL $
@@ -28,7 +30,7 @@ main = withOpenSSL $
           SSL.contextSetCertificate    ctx cert
           SSL.contextSetDefaultCiphers ctx
 
-          let config = defaultConfig {
+          let config = def {
                          cnfServerPort = "9000"
                        , cnfSSLConfig  = Just SSLConfig {
                                            sslServerPort = "9001"
@@ -38,7 +40,7 @@ main = withOpenSSL $
               tree   ∷ ResourceTree
               tree   = C.fromList [ ([], nonGreedy helloWorld) ]
           putStrLn "Access https://localhost:9001/ with your browser."
-          withSocketsDo $ runHttpd config $ resourceMap tree
+          withSocketsDo  runHttpd config $ resourceMap tree
 
 helloWorld ∷ Resource
 helloWorld