You can do all of that in two commands, one on server, one on client using tar, gzip, tee, nc.
On server :
tar cf - dirname/ | gzip -c - |tee dirname.tar.gz | nc -l 3333
On the client
nc serveraddress 3333 > dirname.tar.gz
nc stands for netcat, a usefull tool behaving like cat for network usage.
nc -l 3333 will create a listening socket on local port 3333 and will stream the content of stdin to who ever connects to it.
nc serveraddress 3333 will establish a tcp connexion to server on port 3333, and stream in stdout everything it will receive in the socket connexion.
This is a very easy way to transfer file over different machines while performing various command chaining like tar/gzip/tee ....