I know it's quite basic, but I always get confused between a direct tunnel and a socks tunnel.
So here it is, for later reference:
ssh -N firstname.lastname@example.org -L 5000/chat.facebook.com/5222
tunnels requests to localhost:5000 to chat.facebook.com:5222. This is a static tunnel. The following is a generic tunnel:
ssh -ND 8888 email@example.com
This dynamic tunnel (
-D) can be used as socks 4 or 5 proxy and thus tunnel every request.