1
我需要一個支持經過身份驗證的socks代理的Java套接字客戶端類,java.net.Proxy只支持整個JVM的一組憑據。我有多個代理,每個都有不同的登錄名。 這裏是java的代理Authenticator所做的,只有一個登錄用於整個JVM。我如何擁有多個?java套接字和代理身份驗證
Authenticator.setDefault(new Authenticator(){ protected PasswordAuthentication getPasswordAuthentication(){ PasswordAuthentication p=new PasswordAuthentication("xxx", "xxx".toCharArray()); return p; } });