Compare a remote file with a local file using ssh and diff

# ssh user@example.com cat /path/to/remotefile | diff /path/to/localfile -