use textproto; reimplement protocol parsing