Rumpetroll is written in ruby,but i wirte it in python. I think it is a good demo to learn websocket.