Skip to content

Instantly share code, notes, and snippets.

@sdroege
Created September 22, 2016 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdroege/70969e63fd09b695e503ed96babc93ef to your computer and use it in GitHub Desktop.
Save sdroege/70969e63fd09b695e503ed96babc93ef to your computer and use it in GitHub Desktop.
{-# LANGUAGE OverloadedStrings #-}
import Data.Default
import Network.Connection
import qualified Data.ByteString as B
import Control.Monad
main :: IO ()
main = do
ctx <- initConnectionContext
conn <- connectTo ctx ConnectionParams
{
connectionHostname = "paste.debian.net"
, connectionPort = 443
, connectionUseSecure = Just def
, connectionUseSocks = Nothing
}
connectionPut conn "GET / \r\n"
forever $ do
line <- connectionGetLine 1024 conn
B.putStrLn line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment