mojeda
New Member
I've got a script to server a basic web page using netcat:
#!/bin/bash
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; echo -e "Hello World"; } | nc -l -p 8888; done
On one server running the exact same script, the page will load instantly, however on another server the page continuously keeps trying to load until I go into the CLI and CTRL+C the current loop, and then the browser will immediately show "Hello World".
Refreshing the page will do the same thing and doing CTRL+C allows Hello World to show up.
Any netcat wizards that might know why this is happening? Both servers are running the same version.
Edit:
From what I can tell, the instant the web page loads, net cat stops listening on the port but is still "running"...
#!/bin/bash
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; echo -e "Hello World"; } | nc -l -p 8888; done
On one server running the exact same script, the page will load instantly, however on another server the page continuously keeps trying to load until I go into the CLI and CTRL+C the current loop, and then the browser will immediately show "Hello World".
Refreshing the page will do the same thing and doing CTRL+C allows Hello World to show up.
Any netcat wizards that might know why this is happening? Both servers are running the same version.
Edit:
From what I can tell, the instant the web page loads, net cat stops listening on the port but is still "running"...
Last edited by a moderator: