Port WebSocket code and replace it by using nettys provided encoder/decoder