Created
September 22, 2016 22:04
-
-
Save sdroege/70969e63fd09b695e503ed96babc93ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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