adding proper python code for WebSocket Server