code: def _forward_outbound(self, channel):
          
          try:
              while True:
                  wait_read(channel.fileno())
                  data = channel.recv(1024)
                  if not len(data):
                      return
                  self._websocket.send(json.dumps({'data': data}))
          finally:
              self.close()
docs: Forward outbound traffic (ssh -> websockets)