/** * Build an {@link InetSocketAddress} for the given hostAndPort. * * @param hostAndPort String representation of the host and port * @param proxyServer the current {@link DefaultHttpProxyServer} * @return a resolved InetSocketAddress for the specified hostAndPort * @throws UnknownHostException if hostAndPort could not be resolved, or if the input string could not be parsed into * a host and port. */ public static InetSocketAddress addressFor(String hostAndPort, DefaultHttpProxyServer proxyServer) throws UnknownHostException { HostAndPort parsedHostAndPort; try { parsedHostAndPort = HostAndPort.fromString(hostAndPort); } catch (IllegalArgumentException e) { // we couldn't understand the hostAndPort string, so there is no way we can resolve it. throw new UnknownHostException(hostAndPort); } String host = parsedHostAndPort.getHost(); int port = parsedHostAndPort.getPortOrDefault(80); return proxyServer.getServerResolver().resolve(host, port); }
/** * Build an {@link InetSocketAddress} for the given hostAndPort. * * @param hostAndPort String representation of the host and port * @param proxyServer the current {@link DefaultHttpProxyServer} * @return a resolved InetSocketAddress for the specified hostAndPort * @throws UnknownHostException if hostAndPort could not be resolved, or if the input string could not be parsed into * a host and port. */ public static InetSocketAddress addressFor(String hostAndPort, DefaultHttpProxyServer proxyServer) throws UnknownHostException { HostAndPort parsedHostAndPort; try { parsedHostAndPort = HostAndPort.fromString(hostAndPort); } catch (IllegalArgumentException e) { // we couldn't understand the hostAndPort string, so there is no way we can resolve it. throw new UnknownHostException(hostAndPort); } String host = parsedHostAndPort.getHostText(); int port = parsedHostAndPort.getPortOrDefault(80); return proxyServer.getServerResolver().resolve(host, port); }
/** * Build an {@link InetSocketAddress} for the given hostAndPort. * * @param hostAndPort String representation of the host and port * @param proxyServer the current {@link DefaultHttpProxyServer} * @return a resolved InetSocketAddress for the specified hostAndPort * @throws UnknownHostException if hostAndPort could not be resolved, or if the input string could not be parsed into * a host and port. */ public static InetSocketAddress addressFor(String hostAndPort, DefaultHttpProxyServer proxyServer) throws UnknownHostException { HostAndPort parsedHostAndPort; try { parsedHostAndPort = HostAndPort.fromString(hostAndPort); } catch (IllegalArgumentException e) { // we couldn't understand the hostAndPort string, so there is no way we can resolve it. throw new UnknownHostException(hostAndPort); } String host = parsedHostAndPort.getHost(); int port = parsedHostAndPort.getPortOrDefault(80); return proxyServer.getServerResolver().resolve(host, port); }
this.remoteAddress = proxyServer.getServerResolver().resolve(this.remoteAddress.getHostName(), this.remoteAddress.getPort());
this.remoteAddress = proxyServer.getServerResolver().resolve(this.remoteAddress.getHostName(), this.remoteAddress.getPort());
this.remoteAddress = proxyServer.getServerResolver().resolve(this.remoteAddress.getHostName(), this.remoteAddress.getPort());