The module <a href="http://hackage.haskell.org/packages/archive/HTTP/4000.1.1/doc/html/Network-HTTP.html" rel="noreferrer">
</a>
exposes the functions
and
which I'd like to use for a very basic web server. I wrote a stub that just waits for clients:
Here
gives me a
, and now I can't figure out how to use a
with
.
I found <a href="http://lstephen.wordpress.com/2008/02/14/a-simple-haskell-web-server/" rel="noreferrer">an example</a> with Google, but it is from 2008 and does not work anymore. And I was not able to port it.
Any ideas?
Code:
Network.HTTP
exposes the functions
Code:
receiveHTTP
Code:
respondHTTP
Code:
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Network.HTTP
import Network
import Control.Monad
main = withSocketsDo $ do
socket <- listenOn $ PortNumber 8080
forever $ do
(handle, host, port) <- accept socket
print (host, port)
Here
Code:
accpet
Code:
Handle
Code:
Handle
Code:
receiveHTTP
I found <a href="http://lstephen.wordpress.com/2008/02/14/a-simple-haskell-web-server/" rel="noreferrer">an example</a> with Google, but it is from 2008 and does not work anymore. And I was not able to port it.
Any ideas?