org.littleshoot.proxy.DefaultHostResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of littleproxy Show documentation
Show all versions of littleproxy Show documentation
LittleProxy is a high performance HTTP proxy written in Java and using the Netty networking framework.
The newest version!
package org.littleshoot.proxy;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
/**
* Default implementation of {@link HostResolver} that just uses
* {@link InetAddress#getByName(String)}.
*/
public class DefaultHostResolver implements HostResolver {
@Override
public InetSocketAddress resolve(String host, int port)
throws UnknownHostException {
InetAddress address = InetAddress.getByName(host);
return new InetSocketAddress(address, port);
}
}