getStreamForWebsocket :: S.HostName -> IO WS.Stream
getStreamForWebsocket host = do
  ctx <- SSL.context
  is  <- S.getAddrInfo Nothing (Just host) (Just "443")
  let a = S.addrAddress $ head is
      f = S.addrFamily $ head is
  s <- S.socket f S.Stream S.defaultProtocol
  S.connect s a
  ssl <- SSL.connection ctx s
  SSL.connect ssl
  (i,o) <- sslToStreams ssl
  WS.makeStream  (StreamsIO.read i) (\b -> StreamsIO.write (B.toStrict <$> b) o )
getStreamForWebsocket :: S.HostName -> IO WS.Stream
getStreamForWebsocket host = do
  ctx <- SSL.context
  is  <- S.getAddrInfo Nothing (Just host) (Just "443")
  let a = S.addrAddress $ head is
      f = S.addrFamily $ head is
  s <- S.socket f S.Stream S.defaultProtocol
  S.connect s a
  ssl <- SSL.connection ctx s
  SSL.connect ssl
  (i,o) <- sslToStreams ssl
  WS.makeStream  (StreamsIO.read i) (\b -> StreamsIO.write (B.toStrict <$> b) o )
getStreamForWebsocket host = do
  ctx <- SSL.context
  is  <- S.getAddrInfo Nothing (Just host) (Just "443")
  let a = S.addrAddress $ head is
      f = S.addrFamily $ head is
  s <- S.socket f S.Stream S.defaultProtocol
  S.connect s a
  ssl <- SSL.connection ctx s
  SSL.connect ssl
  (i,o) <- sslToStreams ssl
  WS.makeStream  (StreamsIO.read i) (\b -> StreamsIO.write (B.toStrict <$> b) o )