// SetURLMapForTargetHTTPProxy sets the given UrlMap for the given TargetHttpProxy.
169780
func (g *Cloud) SetURLMapForTargetHTTPProxy(proxy *compute.TargetHttpProxy, urlMapLink string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	ref := &compute.UrlMapReference{UrlMap: urlMapLink}
	mc := newTargetProxyMetricContext("set_url_map")
	return mc.Observe(g.c.TargetHttpProxies().SetUrlMap(ctx, meta.GlobalKey(proxy.Name), ref))
}
763822
func (c *Client) SetURL(baseURL string) {
	c.Lock()
	defer c.Unlock()
	c.apiBase = baseURL
}
533484
func SetAuthProxyHeaders(req *http.Request, username string, groups []string, extra map[string][]string) {
	req.Header.Del("X-Remote-User")
	req.Header.Del("X-Remote-Group")
	for key := range req.Header {
		if strings.HasPrefix(strings.ToLower(key), strings.ToLower("X-Remote-Extra-")) {
			req.Header.Del(key)
		}
	}

	req.Header.Set("X-Remote-User", username)
	for _, group := range groups {
		req.Header.Add("X-Remote-Group", group)
	}
	for key, values := range extra {
		for _, value := range values {
			req.Header.Add("X-Remote-Extra-"+headerKeyEscape(key), value)
		}
	}
}
668823
func AptProxyConfigMap(proxySettings proxy.Settings) map[string]interface{} {
	settings := make(map[string]interface{})
	addIfNotEmpty(settings, AptHTTPProxyKey, proxySettings.Http)
	addIfNotEmpty(settings, AptHTTPSProxyKey, proxySettings.Https)
	addIfNotEmpty(settings, AptFTPProxyKey, proxySettings.Ftp)
	addIfNotEmpty(settings, AptNoProxyKey, proxySettings.NoProxy)
	return settings
}
412859
func (s *CreateApplicationVersionRequest) SetSourceCodeUrl(v string) *CreateApplicationVersionRequest {
	s.SourceCodeUrl = &v
	return s
}
1270062
func (s *EnvironmentDescription) SetEndpointURL(v string) *EnvironmentDescription {
	s.EndpointURL = &v
	return s
}
974522
func (s *CdnConfiguration) SetAdSegmentUrlPrefix(v string) *CdnConfiguration {
	s.AdSegmentUrlPrefix = &v
	return s
}
1134337
func (c *Config) SSHProxyHostPort() (string, int) {
	if c.SSHProxyAddr != "" {
		addr, err := utils.ParseAddr(c.SSHProxyAddr)
		if err == nil {
			return addr.Host(), addr.Port(defaults.SSHProxyListenPort)
		}
	}

	webProxyHost, _ := c.WebProxyHostPort()
	return webProxyHost, defaults.SSHProxyListenPort
}
1148348
func (inst *Instagram) SetProxy(url string, insecure bool) error {
	uri, err := neturl.Parse(url)
	if err == nil {
		inst.c.Transport = &http.Transport{
			Proxy: http.ProxyURL(uri),
			TLSClientConfig: &tls.Config{
				InsecureSkipVerify: insecure,
			},
		}
	}
	return err
}
805239
func (client *Client) setBaseURL(req *request) error {

	if client.endpoint == "" {
		req.baseurl = client.Region.GetEndpoint(client.Internal, req.bucket, client.Secure)
	} else {
		req.baseurl = fmt.Sprintf("%s://%s", getProtocol(client.Secure), client.endpoint)
	}

	return nil
}
495120
func (p *SSHClientParams) TargetHost() string {
	return fmt.Sprintf("%s:%d", p.Host, p.Port)
}
1197651
func (s *AuthorizationData) SetProxyEndpoint(v string) *AuthorizationData {
	s.ProxyEndpoint = &v
	return s
}
297161
func (s *TaskDefinition) SetProxyConfiguration(v *ProxyConfiguration) *TaskDefinition {
	s.ProxyConfiguration = v
	return s
}
249949
func (gce *Cloud) SetURLMapForTargetHTTPProxy(proxy *compute.TargetHttpProxy, urlMap *compute.UrlMap) error {
	op, err := gce.service.TargetHttpProxies.SetUrlMap(gce.projectID, proxy.Name, &compute.UrlMapReference{UrlMap: urlMap.SelfLink}).Do()
	if err != nil {
		return err
	}
	return gce.waitForGlobalOp(op)
}
463396
func (f *Forward) SetProxy(p *Proxy) {
	f.proxies = append(f.proxies, p)
	p.start(f.hcInterval)
}
10456
func (s *CreateProductInput) SetSupportUrl(v string) *CreateProductInput {
	s.SupportUrl = &v
	return s
}
967175
func RequestTargetPort(req *http.Request) int {
	_, portStr, err := net.SplitHostPort(req.Host)
	if err == nil && portStr != "" {
		port, err := strconv.ParseInt(portStr, 0, 64)
		if err == nil {
			return int(port)
		}
	}
	if req.TLS != nil {
		return 443
	}
	return 80
}