netcat in shell script giving invalid connection

view full story

http://unix.stackexchange.com – I have a shell script that uses netcat to listen to localhost on port 1111 for web requests. Every time I try accessing localhost:1111/index.html for example I get: invalid connection to [] from localhost [] 60038 the number at the end (60038) seems to be increasing every time I access localhost. Any suggestions on what's going wrong? And what is the default localhost directory? Where should I put an index.html so that localhost:1111/index.html would work? EDIT here is the full script: #!/bin/sh while true do netcat -vvl localhost -p 1111 -c ' set -x read http_ (HowTos)