In trying to trace a simple HTTP GET request and its response with
nc, I'm running into something strange.
This, for example, works fine: the
in file ends up containing the HTTP GET request and the
out file the response.
$ mkfifo p $ (nc -l 4000 < p | tee in | nc web-server 80 | tee out p)&  8299 $ echo "GET /sample" | nc localhost 4000 This is contents of /sample... $ cat out This is contents of /sample... $
However, if I replace the
tee out p above with
tee out >p, then the
out file turns out to be empty.
$ (nc -l 4000 < p | tee in | nc web-server 80 | tee out > p)&  8312 $ echo "GET /sample" | nc localhost 4000 $ cat out $
Why should this be so?
EDIT: I'm on RHEL 5.3 (Tikanga).