[Haskell-cafe] Network.CGI.Compat.pwrapper

Gracjan Polak gracjanpolak at gmail.com
Mon Feb 12 08:22:47 EST 2007


Hi,

I wanted to setup really simple http server, found Network.CGI.Compat.pwrapper
and decided it suits my needs. Code:

module Main where
import Network.CGI
import Text.XHtml
import Network

doit vars = do
    return (body (toHtml (show vars)))

main = withSocketsDo (pwrapper (PortNumber 7777) doit)


Pointng any browser to http://127.0.0.1:7777 does not render the page. It seems
the response headers are broken.

How do I report this bug (trac? something else?).

We might want to either fix it, or just get rid of it, as nobody seems to notice
the problem :)

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.6

Tested under WinXP and MacOSX 10.4.9.

Another question is: how do I do equivalent functionality without pwrapper?

-- 
Gracjan





More information about the Haskell-Cafe mailing list