代理iP賬密請求https時報錯Proxy returns "HTTP/1.0 407 Proxy Authentication Required"

hutool http proxy 設置以下代碼有用,jodd http不行

後來翻閱多方材料後發現以一下代碼方式可以實現:

System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");
Authenticator.setDefault(
    new Authenticator() {
        @Override
        public PasswordAuthentication getPasswordAuthentication() {
              return new PasswordAuthentication(authUser, authPassword.toCharArray());
        }
    }
);
        
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章