4
필자는 authetication을 지원하는 java socks Proxy 클라이언트 클래스를 찾고 있는데, 어떤 제안 사항이 있습니까? java.net.Proxy는 인증을 지원하지 않습니다.인증을 지원하는 Java 프록시 클라이언트 클래스
편집 : 소켓을 통해 특정 프록시 호스트에 인증 데이터를 첨부하는 방법을 찾지 못하는 것 같습니다. Authenticator.setDefault()는 하나의 자격 증명 집합 만 허용합니다.
Authenticator.setDefault(new Authenticator(){
protected PasswordAuthentication getPasswordAuthentication(){
PasswordAuthentication p=new PasswordAuthentication("xxx", "xxx".toCharArray());
return p;
}
});
Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("xxx.xx.xxx.xxx", xxx));
Socket sock = new Socket(proxy);
sock.connect(new InetSocketAddress(server,xx));