The libraries in this subsection are as follows:
Basic low-level networking using the network
package has been discussed in Chapter 6, I/O and Streaming.
For a bit higher-level TCP client communication, the connection
package provides a nice little abstraction layer. Plus, connection
supports SSL/TLS and SOCKS with minimal configuration. A connection is established primarily by defining a configuration value of type ConnectionParams
, given by:
data ConnectionParams = ConnectionParams { connectionHostname :: HostName , connectionPort :: PortNumber , connectionUseSecure :: Maybe TLSSettings , connectionUseSocks :: Maybe ProxySettings }
This is a simple yet effective API for all primitive TCP connections. The get
and put
operations use ByteString as data format. connection
...