Modified WebSocket server to use the Server class