...
public void setProxy
() {
if
(isUseHTTPProxy()) {
// HTTP/
HTTPS Proxy
System.setProperty
("http.proxyHost",
getHTTPHost());
System.setProperty
("http.proxyPort",
getHTTPPort());
System.setProperty
("https.proxyHost",
getHTTPHost());
System.setProperty
("https.proxyPort",
getHTTPPort());
if
(isUseHTTPAuth()) {
String
encoded = new String
(Base64.encodeBase64
((getHTTPUsername()
+ ":" +
getHTTPPassword
()).getBytes()));
con.
setRequestProperty
("Proxy-
Authorization",
"Basic " +
encoded);
Authenticator.
setDefault(new
ProxyAuth
(getHTTPUsername(),
getHTTPPassword()));
}
}
if
(isUseSOCKSProxy())
{
// SOCKS
Proxy
System.setProperty
("socksProxyHost",
getSOCKSHost());
System.setProperty
("socksProxyPort",
getSOCKSPort());
if
(isUseSOCKSAuth()) {
System.
setProperty
("java.net.socks.
username",
getSOCKSUsername());
System.setProperty
("java.net.socks.
password",
getSOCKSPassword());
Authenticator.
setDefault(new
ProxyAuth
(getSOCKSUsername
(), getSOCKSPassword
()));
}
}
}
...
public class
ProxyAuth extends
Authenticator {
private
PasswordAuthenticati
on auth;
private
ProxyAuth(String
user, String
password) {
auth = new
PasswordAuthenticati
on(user, password
== null ? new char
[]{} :
password.toCharArray
());
}
protected
PasswordAuthenticati
on
getPasswordAuthentic
ation() {
return auth;
}
}
...
In fact , i'd like to add others inputs such as inject querry /url , inject host and port like in the picture but i need help