code: func NewXForwarded(insecure bool, trustedIps []string, next http.Handler) (*XForwarded, error) {
  	var ipChecker *ip.Checker
  	if len(trustedIps) > 0 {
  		var err error
  		ipChecker, err = ip.NewChecker(trustedIps)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	hostname, err := os.Hostname()
  	if err != nil {
  		hostname = "localhost"
  	}
  
  	return &XForwarded{
  		insecure:   insecure,
  		trustedIps: trustedIps,
  		ipChecker:  ipChecker,
  		next:       next,
  		hostname:   hostname,
  	}, nil
  }
docs: // NewXForwarded creates a new XForwarded.