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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -