[Haskell] ANNOUNCE: connection

Vincent Hanquez tab at snarc.org
Sun Nov 4 11:55:32 CET 2012


Hi Haskellers,

I'm pleased to announce the release of connection. Connection is the pinnacle of 
most of my network related packages, and wrap together all the libraries needed 
to provide a easy and smooth experience to open client connection.

It provides very simple access to SOCKS and TLS along with normal raw client socket.
The goal is to hide most complicated settings either completely or re-expose 
them more simply, and provide safe defaults.

repository: https://github.com/vincenthz/hs-connection
hackage: http://hackage.haskell.org/package/connection

Two simple examples (more can be find in the README on github):

- opening a raw connection to www.example.com port 80:

    ctx <- initConnectionContext
    connectTo ctx $ ConnectionParams
                               { connectionHostname  = "www.example.com"
                               , connectionPort      = fromIntegral 80
                               , connectionUseSecure = Nothing
                               , connectionUseSocks  = Nothing
                               }

- opening a TLS connection to www.example.com port 443:

    ctx <- initConnectionContext
    connectTo ctx $ ConnectionParams
                               { connectionHostname  = "www.example.com"
                               , connectionPort      = fromIntegral 443
                               , connectionUseSecure = Just def
                               , connectionUseSocks  = Nothing
                               }


Enjoy, do reports bug and suggestions the usual way (on github issue tracker or 
by email)

-- 
Vincent @vincenthz



More information about the Haskell mailing list