[web-devel] http-enumerator connecting via a http proxy

Erik de Castro Lopo mle+hs at mega-nerd.com
Sun Jun 26 02:32:03 CEST 2011


Erik de Castro Lopo wrote:

>         doConnect = do
>             h <- connectTo phost (PortNumber $ fromIntegral pport)
>             -- Need to send connectRequest and get a HTTP 200 response.
>             return h

For this problem I do have the following solution:

        doConnect = do
            h <- connectTo phost (PortNumber $ fromIntegral pport)
            S8.hPutStr h $ toByteString connectRequest
            hFlush h
            din <- S.hGetSome h 1024
            return h

This does actually work correctly during my simplistic testing but
this code doesn't really deserve to go into a package called
http-enumerator :-).

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/



More information about the web-devel mailing list