Harold Abnabit came up with this approach1:
http://blog.habnab.it/blog/2013/06/25/emacsclient-and-tramp/
1 based on an earlier article by Ryan Barrett (to which he links).
FWIW there's also http://stackoverflow.com/q/5154224/324105https://stackoverflow.com/q/5154224/324105 in which Petri Lehtinen came up with https://gist.github.com/akheron/850795. I imagine the more complex solutions are better, but a very simple approach might still be of interest.