implement a StreamMultiplex to handle sessions
写了半天，发现有开源的multiplex实现