public static Address from(String hostAndPort) { String host; int port; int colon = hostAndPort.indexOf(':'); if (colon >= 0) { host = hostAndPort.substring(0, colon); port = Integer.parseInt(hostAndPort.substring(colon + 1)); } else { host = hostAndPort; port = 0; } return new Address(host, port); }
public void setProxy(String host, int port) { setProxy(new org.eclipse.jetty.client.Address(host, port)); }
/** * @param uri * an absolute URI (for example 'http://localhost/foo/bar?a=1') */ public void setURI(URI uri) { if (!uri.isAbsolute()) throw new IllegalArgumentException("!Absolute URI: " + uri); if (uri.isOpaque()) throw new IllegalArgumentException("Opaque URI: " + uri); if (LOG.isDebugEnabled()) LOG.debug("URI = {}",uri.toASCIIString()); String scheme = uri.getScheme(); int port = uri.getPort(); if (port <= 0) port = "https".equalsIgnoreCase(scheme)?443:80; setScheme(scheme); setAddress(new Address(uri.getHost(),port)); HttpURI httpUri = new HttpURI(uri); String completePath = httpUri.getCompletePath(); setRequestURI(completePath == null?"/":completePath); }
exch.setAddress(new Address(host, port)); exch.setURI(getRequestURI()); try {
void associate(AbstractHttpConnection connection) { if (connection.getEndPoint().getLocalAddr() != null) _localAddress = new Address(connection.getEndPoint().getLocalAddr(),connection.getEndPoint().getLocalPort()); _connection = connection; if (getStatus() == STATUS_CANCELLING) abort(); }
exch.setAddress(new Address(host, port)); exch.setURI(getRequestURI()); try {
httpClient.setProxy( new Address( proxyInfo.getHost(), proxyInfo.getPort() ) );
ex.setAddress(new Address(host.getHost(), host.getPort())); ex.setURI(url);
jettyClient.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL); if (proxyHost != null) { jettyClient.setProxy(new Address(proxyHost, proxyPort)); if (proxyUsername != null) { jettyClient.setProxyAuthentication(new ProxyAuthorization(proxyUsername, proxyPassword));