It's said its handled automatically, however from my experience this isn't the whole story, and to save someone else a headache this should be remedied in the docs.
Just some background I had a connect middleware for no-www, and options..
This should just be documented somewhere is all. It would have saved me the hour of "hmm, why is this falling back to xhr-polling?" time and source-reading lines to see the "magic"
if (!callback) { proxy.proxyWebSocketRequest(req, socket, head);}
But, more than willing to give up that hour for the total amount of time you've saved me