code: func readAddrType(conn net.Conn) (int, error) {
  	// Read in the type of the remote host.
  	addrType, err := readByte(conn)
  	if err != nil {
  		return 0, trace.Wrap(err)
  	}
  
  	// Based off the type, determine how many more bytes to read in for the
  	// remote address. For IPv4 it's 4 bytes, for IPv6 it's 16, and for domain
  	// names read in another byte to determine the length of the field.
  	switch addrType {
  	case socks5AddressTypeIPv4:
  		return net.IPv4len, nil
  	case socks5AddressTypeIPv6:
  		return net.IPv6len, nil
  	case socks5AddressTypeDomainName:
  		len, err := readByte(conn)
  		if err != nil {
  			return 0, trace.Wrap(err)
  		}
  		return int(len), nil
  	default:
  		return 0, trace.BadParameter("unsupported address type: %v", addrType)
  	}
  }
docs: // readAddrType reads in the address type and returns the length of the dest
  // addr field.