5

netcat in shell script giving invalid connection

view full story
linux-howto

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 [127.0.0.1] from localhost [127.0.0.1] 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)