second-transfer-0.5.5.1: Second Transfer HTTP/2 web server

Safe HaskellNone
LanguageHaskell2010

SecondTransfer.MainLoop

Contents

Synopsis

High level OpenSSL functions.

Use these functions to create your TLS-compliant HTTP/2 server in a snap.

tlsServeWithALPN Source

Arguments

:: FilePath

Path to a certificate the server is going to use to identify itself. Bear in mind that multiple domains can be served from the same HTTP/2 TLS socket, so please create the HTTP/2 certificate accordingly. Also, currently this function only accepts paths to certificates or certificate chains in .pem format.

-> FilePath

Path to the key of your certificate.

-> String

Name of the network interface where you want to start your server

-> [(String, Attendant)]

List of protocol names and the corresponding Attendant to use for each. This way you can serve both HTTP/1.1 over TLS and HTTP/2 in the same socket. When no ALPN negotiation is present during the negotiation, the first protocol in this list is used.

-> Int

Port to open to listen for connections.

-> IO () 

Simple function to open

tlsServeWithALPNAndFinishOnRequest Source

Arguments

:: FilePath 
-> FilePath

Same as for tlsServeWithALPN

-> String

Same as for tlsServeWithALPN

-> [(String, Attendant)]

Same as for tlsServeWithALPN

-> Int

Same as for tlsServeWithALPN

-> MVar FinishRequest

Finish request, write a value here to finish serving

-> IO () 

Interruptible version of tlsServeWithALPN. Use the extra argument to ask the server to finish: you pass an empty MVar and when you want to finish you just populate it.

enableConsoleLogging :: IO () Source

Activates logging to terminal

logit :: ByteString -> IO () Source

data TLSLayerGenericProblem Source

Exceptions inheriting from IOProblem. This is thrown by the OpenSSL subsystem to signal that the connection was broken or that otherwise there was a problem at the SSL layer.

Constructors

TLSLayerGenericProblem String 

data FinishRequest Source

Singleton type. Used in conjunction with an MVar. If the MVar is full, the fuction tlsServeWithALPNAndFinishOnRequest knows that it should finish at its earliest convenience and call the CloseAction for any open sessions.

Constructors

FinishRequest