Safe Haskell | None |
---|---|
Language | Haskell2010 |
- tlsServeWithALPN :: forall ctx session. TLSContext ctx session => Proxy ctx -> ConnectionCallbacks -> ByteString -> ByteString -> String -> NamedAttendants -> Int -> IO ()
- tlsServeWithALPNNSSockAddr :: forall ctx session. TLSContext ctx session => Proxy ctx -> ConnectionCallbacks -> ByteString -> ByteString -> SockAddr -> NamedAttendants -> IO ()
- tlsSessionHandler :: (TLSContext ctx session, TLSServerIO encrypted_io, HasSocketPeer encrypted_io) => MVar SessionHandlerState -> NamedAttendants -> ctx -> encrypted_io -> IO ()
- tlsServeWithALPNUnderSOCKS5SockAddr :: forall ctx session. TLSContext ctx session => Proxy ctx -> ConnectionCallbacks -> Socks5ConnectionCallbacks -> ByteString -> ByteString -> SockAddr -> NamedAttendants -> [ByteString] -> Bool -> IO ()
- data NormalTCPHold
- tlsServeWithALPNNSSockAddr_Prepare :: forall ctx session. TLSContext ctx session => Proxy ctx -> ConnectionCallbacks -> ByteString -> ByteString -> SockAddr -> IO NamedAttendants -> IO NormalTCPHold
- tlsServeWithALPNNSSockAddr_Do :: NormalTCPHold -> IO ()
- data Socks5Hold
- tlsServeWithALPNUnderSOCKS5SockAddr_Prepare :: forall ctx session. TLSContext ctx session => Proxy ctx -> ConnectionCallbacks -> Socks5ConnectionCallbacks -> ByteString -> ByteString -> SockAddr -> IO NamedAttendants -> [ByteString] -> Bool -> IO Socks5Hold
- tlsServeWithALPNUnderSOCKS5SockAddr_Do :: Socks5Hold -> IO ()
- coreListen :: forall a ctx session b. (TLSContext ctx session, TLSServerIO b, HasSocketPeer b) => Proxy ctx -> ConnectionCallbacks -> ByteString -> ByteString -> a -> (a -> (b -> IO ()) -> IO ()) -> [(String, Attendant)] -> IO ()
- type NamedAttendants = [(String, Attendant)]
- chooseProtocol :: [(String, a)] -> [ByteString] -> IO (Maybe Int)
Simpler interfaces
:: 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.
:: 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
:: 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
data NormalTCPHold
tlsServeWithALPNNSSockAddr_Prepare
:: 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
:: 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 |
:: (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
chooseProtocol :: [(String, a)] -> [ByteString] -> IO (Maybe Int)