java - Authentication when connecting to multiple proxies -
i can't figure out how provide login , password proxies (multiple ones) when i'm connecting it. say, my main proxy
can used multiple clients , each time may connect different proxyx
in parallel (in different threads). , there can multiple connections open @ same time.
client ---> main proxy ---> proxy1 ----> internet
or
client ---> main proxy ---> proxy2 ----> internet
or
client ---> main proxy ---> proxy3 ----> internet
i've found out class authenticator
can used. it, if understand correctly, affects connections @ same time, 1 pair of login-password can interfere another. so?
the bottom line want provide login , password each individual connection my main proxy
proxyx
.
i'm connecting proxyx
following way:
/*how provide login , password?*/ proxy proxy = new proxy(proxy.type.http, new inetsocketaddress("proxy.host", 8080)); httpurlconnection httpconnection = (httpurlconnection)url.openconnection(proxy);
or
/*how provide login , password?*/ proxy proxy = new proxy(proxy.type.socks, new inetsocketaddress("proxy.host", 80)); socket socket = new socket(proxy); inetsocketaddress socketaddress = new inetsocketaddress(address, port); socket.connect(socketaddress, 1000);
Comments
Post a Comment