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

Safe HaskellNone
LanguageHaskell2010

SecondTransfer.TLS.CoreServer

Contents

Synopsis

Simpler interfaces

tlsServeWithALPN

Arguments

:: TLSContext ctx session 
=> Proxy ctx

This is a simple proxy type from Typeable that is used to select the type of TLS backend to use during the invocation

-> ConnectionCallbacks

Control and log connections

-> ByteString

String with contents of certificate chain

-> ByteString

String with contents of PKCS #8 key

-> String

Name of the network interface

-> NamedAttendants

List of attendants and their handlers

-> Int

Port to listen for connections

-> IO () 

Convenience function to open a port and listen there for connections and select protocols and so on.

tlsServeWithALPNNSSockAddr

Arguments

:: TLSContext ctx session 
=> Proxy ctx

This is a simple proxy type from Typeable that is used to select the type of TLS backend to use during the invocation

-> ConnectionCallbacks

Control and regulate SOCKS5 connections

-> ByteString

String with contents of certificate chain

-> ByteString

String with contents of PKCS #8 key

-> SockAddr

Address to bind to

-> NamedAttendants

List of attendants and their handlers

-> IO () 

Use a previously given network address

tlsSessionHandler :: (TLSContext ctx session, TLSServerIO encrypted_io, HasSocketPeer encrypted_io) => MVar SessionHandlerState -> NamedAttendants -> ctx -> encrypted_io -> IO ()

tlsServeWithALPNUnderSOCKS5SockAddr

Arguments

:: TLSContext ctx session 
=> Proxy ctx

This is a simple proxy type from Typeable that is used to select the type of TLS backend to use during the invocation

-> ConnectionCallbacks

Log and control of the inner TLS session

-> Socks5ConnectionCallbacks

Log and control the outer SOCKS5 session

-> ByteString

String with contents of certificate chain

-> ByteString

String with contents of PKCS #8 key

-> SockAddr

Address to bind to

-> NamedAttendants

List of attendants and their handlers,

-> [ByteString]

Names of "internal" hosts

-> Bool

Should I forward connection requests?

-> IO () 

Interfaces for a pre-fork scenario

tlsServeWithALPNNSSockAddr_Prepare

Arguments

:: TLSContext ctx session 
=> Proxy ctx

This is a simple proxy type from Typeable that is used to select the type of TLS backend to use during the invocation

-> ConnectionCallbacks

Control and regulate SOCKS5 connections

-> ByteString

String with contents of certificate chain

-> ByteString

String with contents of PKCS #8 key

-> SockAddr

Address to bind to

-> IO NamedAttendants

Will-be list of attendants and their handlers

-> IO NormalTCPHold 

The prefork way requires a first step where we create the sockets and then we listen on them... This function is identical otherwise to the one without _Prepare. The real thing is done by the one with _Do below...

tlsServeWithALPNNSSockAddr_Do :: NormalTCPHold -> IO ()

Actually listen, possibly at the other side of the fork.

data Socks5Hold

Opaque hold type

tlsServeWithALPNUnderSOCKS5SockAddr_Prepare

Arguments

:: TLSContext ctx session 
=> Proxy ctx

This is a simple proxy type from Typeable that is used to select the type of TLS backend to use during the invocation

-> ConnectionCallbacks

Log and control of the inner TLS session

-> Socks5ConnectionCallbacks

Log and control the outer SOCKS5 session

-> ByteString

String with contents of certificate chain

-> ByteString

String with contents of PKCS #8 key

-> SockAddr

Address to bind to

-> IO NamedAttendants

List of attendants and their handlers, as it will be built

-> [ByteString]

Names of "internal" hosts

-> Bool

Should I forward connection requests?

-> IO Socks5Hold 

coreListen

Arguments

:: (TLSContext ctx session, TLSServerIO b, HasSocketPeer b) 
=> Proxy ctx

This is a simple proxy type from Typeable that is used to select the type of TLS backend to use during the invocation

-> ConnectionCallbacks

Functions to log and control behaviour of the server

-> ByteString

PEM-encoded certificate chain, in this string

-> ByteString

PEM-encoded, un-encrypted PKCS #8 key in this string

-> a

An entity that is used to fork new handlers

-> (a -> (b -> IO ()) -> IO ())

The fork-handling functionality

-> [(String, Attendant)]

List of attendants and their handlers

-> IO () 

Utility

type NamedAttendants = [(String, Attendant)]

A simple Alias

Conduit-based session management