Currently the network code of gpgol.js grew organically and is a bit more complex than it should be.
We for example don't need to have a HTTP server in the native client (composer + viewer) and could instead just reuse the websocket connection from the server.