code: func Handshake(conn net.Conn) (string, error) {
  	// Read in the version and reject anything other than SOCKS5.
  	version, err := readByte(conn)
  	if err != nil {
  		return "", trace.Wrap(err)
  	}
  	if version != socks5Version {
  		return "", trace.BadParameter("only SOCKS5 is supported")
  	}
  
  	// Read in the authentication method requested by the client and write back
  	// the method that was selected. At the moment only "no authentication
  	// required" is supported.
  	authMethods, err := readAuthenticationMethod(conn)
  	if err != nil {
  		return "", trace.Wrap(err)
  	}
  	if !byteSliceContains(authMethods, socks5AuthNotRequired) {
  		return "", trace.BadParameter("only 'no authentication required' is supported")
  	}
  	err = writeMethodSelection(conn)
  	if err != nil {
  		return "", trace.Wrap(err)
  	}
  
  	// Read in the request from the client and make sure the requested command
  	// is supported and extract the remote address. If everything is good, write
  	// out a success response.
  	remoteAddr, err := readRequest(conn)
  	if err != nil {
  		return "", trace.Wrap(err)
  	}
  	err = writeReply(conn)
  	if err != nil {
  		return "", trace.Wrap(err)
  	}
  
  	return remoteAddr, nil
  }
docs: // Handshake performs a SOCKS5 handshake with the client and returns
  // the remote address to proxy the connection to.