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 needs full url in order to replace http protocol by
ws one.

It also fixes iframe based transports.