wuss 1.0.1 → 1.0.2
raw patch · 3 files changed
+35/−1 lines, 3 files
Files
- CHANGELOG.md +4/−0
- Wuss.hs +30/−0
- wuss.cabal +1/−1
CHANGELOG.md view
@@ -2,6 +2,10 @@ Wuss uses [Semantic Versioning][]. +## v1.0.2 (2015-06-04)++- Added an example without certificate validation.+ ## v1.0.1 (2015-06-04) - Improved documentation.
Wuss.hs view
@@ -75,6 +75,36 @@ >>> let headers = [] >>> let app _connection = return () >>> runSecureClientWith "echo.websocket.org" 443 "/" options headers app++ If you want to run a secure client without certificate validation, use+ 'Network.WebSockets.runClientWithStream'. For example:++ > let host = "echo.websocket.org"+ > let port = 443+ > let path = "/"+ > let options = defaultConnectionOptions+ > let headers = []+ > let tlsSettings = TLSSettingsSimple+ > -- This is the important setting.+ > { settingDisableCertificateValidation = True+ > , settingDisableSession = False+ > , settingUseServerName = False+ > }+ > let connectionParams = ConnectionParams+ > { connectionHostname = host+ > , connectionPort = port+ > , connectionUseSecure = Just tlsSettings+ > , connectionUseSocks = Nothing+ > }+ >+ > context <- initConnectionContext+ > connection <- connectTo context connectionParams+ > stream <- makeStream+ > (fmap Just (connectionGetChunk connection))+ > (maybe (return ()) (connectionPut connection . toStrict))+ > runClientWithStream stream host path options headers $ \ connection -> do+ > -- Do something with the connection.+ > return () -} runSecureClientWith :: HostName -- ^ Host
wuss.cabal view
@@ -1,5 +1,5 @@ name: wuss-version: 1.0.1+version: 1.0.2 cabal-version: >=1.10 build-type: Simple license: MIT