📝 Playing around with netcat
This commit is contained in:
parent
58a1590583
commit
e40b10096e
5 changed files with 28 additions and 9 deletions
13
scripts/nc_play/nk
Executable file
13
scripts/nc_play/nk
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
servefile="$1"
|
||||
port="$2"
|
||||
|
||||
main() {
|
||||
while :
|
||||
do
|
||||
echo -e "HTTP/1.1 200 OK\n\n$(cat "$servefile")" | nc -l -p "$port" -q 1
|
||||
done
|
||||
}
|
||||
|
||||
main
|
||||
Loading…
Add table
Add a link
Reference in a new issue