Sets the host component for this URI.

 @param [String, #to_str] new_host The new host component.
188228
def host=(new_host)
      if new_host && !new_host.respond_to?(:to_str)
        raise TypeError, "Can't convert #{new_host.class} into String."
      end
      @host = new_host ? new_host.to_str : nil

      # Reset dependent values
      remove_instance_variable(:@authority) if defined?(@authority)
      remove_instance_variable(:@normalized_host) if defined?(@normalized_host)
      remove_composite_values

      # Ensure we haven't created an invalid URI
      validate()
    end
713478
def set_local_proxy(value)
			if value
				uri = URI.parse(value)
				@proxy = Proxy.new(uri.host, uri.port, uri.user, uri.password)
			else
				@proxy = Proxy.new()
			end
		end
888305
public void setHost(String host) {
		if(isModifiable == ModifiableRule.ContactSystem || isModifiable == ModifiableRule.NotModifiable) {
			throw new IllegalArgumentException("Host part of the URI is not modifiable");
		}
		try {
			getSipURI().setHost(host);
		} catch (ParseException e) {
			logger.error("parse exception occured", e);
			throw new IllegalArgumentException("Bad arg!",e);
		}
	}
1177523
public void setProxyHostsWhiteList(String[] hosts)
    {
        if (hosts == null || hosts.length == 0)
            _proxyHostsWhiteList = null;
        else
        {
            _proxyHostsWhiteList = new HashSet();
            for (int i = 0; i < hosts.length; i++)
                if (hosts[i] != null && hosts[i].trim().length() > 0)
                    _proxyHostsWhiteList.add(hosts[i]);
        }
    }
88203
def console_host(self, new_host):
        
        server_config = Config.instance().get_section_config("Server")
        remote_console_connections = server_config.getboolean("allow_remote_console")
        if remote_console_connections:
            log.warning("Remote console connections are allowed")
            self._console_host = "0.0.0.0"
        else:
            self._console_host = new_host
1319727
public static void setOutputHost(Configuration conf, String host) {
        log.info("setting " + OUTPUT_HOST + " to " + host);
        conf.set(OUTPUT_HOST, host);
    }
1019537
def host_externally=(new_val)
      return nil if new_val == @host_externally
      raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
      @host_externally = new_val
      @need_to_update = true
    end
185629
public void setBuildHost( final CharSequence host) {
		if ( host != null) format.getHeader().createEntry( BUILDHOST, host);
	}
232683
def with_host(self, host):
        
        # N.B. doesn't cleanup query/fragment
        if not isinstance(host, str):
            raise TypeError("Invalid host type")
        if not self.is_absolute():
            raise ValueError("host replacement is not allowed " "for relative URLs")
        if not host:
            raise ValueError("host removing is not allowed")
        host = self._encode_host(host)
        val = self._val
        return URL(
            self._val._replace(
                netloc=self._make_netloc(
                    val.username, val.password, host, val.port, encode=False
                )
            ),
            encoded=True,
        )
1215389
def join_uri(scheme, userinfo, host, port, registry, path, opaque, query, fragment)
      URI::Generic.new(scheme, userinfo, host, port, registry, path, opaque, query, fragment).to_s
    end
1186156
def _apply_section_hosts(self, section, hosts):
        
        for entry in section['entries']:
            for hostname in self.expand_hostdef(entry['name']):
                if hostname not in hosts:
                    # Expanded host or child host or something else refers to a
                    # host that isn't actually defined. Ansible skips this, so
                    # we will too.
                    continue
                host = hosts[hostname]
                for var_key, var_val in entry['hostvars'].items():
                    host['hostvars'][var_key] = var_val
683238
def set_node(self, host, port, server_type=None):
        
        node_name = "{0}:{1}".format(host, port)
        node = {
            'host': host,
            'port': port,
            'name': node_name,
            'server_type': server_type
        }
        self.nodes[node_name] = node
        return node
45873
def tld=(new_tld)
      replaced_tld = domain.sub(/#{tld}\z/, new_tld)
      self.host = PublicSuffix::Domain.new(replaced_tld).to_s
    end
768551
def set_host_def(self, hostdef):
        '''
        
        '''
        if self._hostdef is not None:
            self.info("Overwriting previous hostdef, which was %r",
                      self._hostdef)
        self._hostdef = hostdef
548123
function it_retains_the_original_state_of_the_instance_duplicated_with_a_new_host()
    {
        $original_uri = (string) $this->getWrappedObject();

        $new_host = $this->withHost("quux.qux");

        $this->__toString()->shouldReturn($original_uri);
    }
370044
private function setHostFromUri()
    {
        $this->hostFromUri = true;

        $host = $this->uri->getHost();

        if (!empty($host)) { // Do not set Host header if URI has no host.
            $port = $this->uri->getPort();
            if (null !== $port) {
                $host = sprintf('%s:%d', $host, $port);
            }

            parent::setHeader('Host', $host);
        }
    }
567846
def add_or_return_host(self, host):
        
        with self._hosts_lock:
            try:
                return self._hosts[host.endpoint], False
            except KeyError:
                self._hosts[host.endpoint] = host
                return host, True