SyntaxFix
Write A Post
Hire A Developer
Questions
On a current netcat (v0.7.1) you have a -c switch:
-c, --close close connection on EOF from stdin
Hence,
echo "hi" | nc -cu localhost 8000
should do the trick.