code: func (s *APIServer) getSessionChunk(auth ClientI, w http.ResponseWriter, r *http.Request, p httprouter.Params, version string) (interface{}, error) {
  	sid, err := session.ParseID(p.ByName("id"))
  	if err != nil {
  		return nil, trace.BadParameter("missing parameter id")
  	}
  	namespace := p.ByName("namespace")
  	if !services.IsValidNamespace(namespace) {
  		return nil, trace.BadParameter("invalid namespace %q", namespace)
  	}
  
  	// "offset bytes" query param
  	offsetBytes, err := strconv.Atoi(r.URL.Query().Get("offset"))
  	if err != nil || offsetBytes < 0 {
  		offsetBytes = 0
  	}
  	// "max bytes" query param
  	max, err := strconv.Atoi(r.URL.Query().Get("bytes"))
  	if err != nil || offsetBytes < 0 {
  		offsetBytes = 0
  	}
  	log.Debugf("apiserver.GetSessionChunk(%v, %v, offset=%d)", namespace, *sid, offsetBytes)
  	w.Header().Set("Content-Type", "text/plain")
  
  	buffer, err := auth.GetSessionChunk(namespace, *sid, offsetBytes, max)
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  	if _, err = w.Write(buffer); err != nil {
  		return nil, trace.Wrap(err)
  	}
  	w.Header().Set("Content-Type", "application/octet-stream")
  	return nil, nil
  }
docs: // HTTP GET /:version/sessions/:id/stream?offset=x&bytes=y
  // Query parameters:
  //   "offset"   : bytes from the beginning
  //   "bytes"    : number of bytes to read (it won't return more than 512Kb)