JSoup-无法通过经过身份验证的代理隧道

时间:2018-06-25 16:40:19

标签: java proxy jsoup tunneling

我遇到Unable to tunnel through proxy - Jsoup中所述的类似问题。尝试连接测试页时,我得到了这样的证明:

H

我的ProxyAuthenticator类:

Exception in thread "main" java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"

以及带有示例代码的我的代理配置

import java.net.Authenticator;
import java.net.PasswordAuthentication;

public class ProxyAuthenticator extends Authenticator{

private String userName, password;

protected PasswordAuthentication getPasswordAuthentication(){
    return new PasswordAuthentication(userName,password.toCharArray());
}

public ProxyAuthenticator(String userName, String password){
    this.userName = userName;
    this.password = password;
}

能请你帮忙吗?

0 个答案:

没有答案