Generate full URL from document one for SockJS client

This allows this application to work even if deployed to other
context paths (like /) and also enables to use websocket transport
since SockJS need full url in order to replace http protocol by
ws one.

Issue: