You can use this package: https://github.com/gadicohen/meteor-headers. It gets headers on both client and server.
If you want to do it without a package, you can 'inspire' yourself from the code above, the thing to remember is that prior to 0.6.5 we used the 'hidden' __meteor_bootstrap__.app
and post 0.6.5 it's recommended to use WebApp.connectHandler
instead.