Last active
November 1, 2015 18:37
-
-
Save glasserc/3f867fb9538d64fcd63d to your computer and use it in GitHub Desktop.
many-tls: TlsExceptionHostPort (HandshakeFailed (Error_Packet_unexpected "Alert [(AlertLevel_Fatal,BadRecordMac)]" " expected: change cipher"))
This file contains 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
import Control.Concurrent | |
import Control.Concurrent.STM | |
import Control.Monad | |
import Network.HTTP.Client | |
import Network.HTTP.Client.TLS | |
numThreads = 250 | |
main = do | |
manager <- newManager tlsManagerSettings {managerConnCount=1000} | |
request <- parseUrl "https://www.google.com/" | |
chan <- newTChanIO | |
replicateM_ numThreads $ forkRequest request manager chan | |
allResponses <- readNTChan numThreads chan | |
print allResponses | |
forkRequest request manager chan = | |
forkIO $ | |
withResponse request manager $ \resp -> atomically $ | |
writeTChan chan $ responseStatus resp | |
readNTChan num chan = atomically $ | |
replicateM num $ readTChan chan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment