compartmentalize websocket