just do d.on('remote', fn) on the "server" code