You can use HAProxy or the nginx echo module for this. You don't even need to bother creating an index file to be served. location / { echo "42"; } In fact, I wonder if I could use iptables to return a string... Oh, even better - There's probably a jQuery plugin for this!
An FPGA with a full-blown TCP/IP stack would be cute, too.