Refactor peer, control and proxy web socket connection interfaces