implement handshake prototype

jshint complains because it's a JS keyword