I'm playing around with Nimrod a bit, and I've tried the HTTPServer module. I first thought it didn't work as when I tried to go to the web page in Safari, my standard browser, it gave an error. There error was something like this: (sorry if it isn't exactly right, it's translated from dutch)
Safari can't open this page Safari cannot open page localhost:5000, as the network connection has been lost unexpectedly
But, when I try to open the page in Chrome or Firefox, it works just fine
My Nimrod code:
import strutils, sockets, httpserver
var counter = 0
proc handleRequest(client: TSocket, path, query: string): bool {.procvar.} =
inc(counter)
client.send("Hello for the $#th time." % $counter & wwwNL)
return false # do not stop processing
run(handleRequest, TPort(5000))