Seperate WebSocket into library