added resolving buffer indexes in bufferToProtocol and websocket modules