Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java.net.sockets and MS Proxy

Reply
Thread Tools

java.net.sockets and MS Proxy

 
 
Jack Vamvas
Guest
Posts: n/a
 
      07-13-2003
I am currently working on a whiteboard application , that uses
java.net.socket as the connection method.
If MS Proxy 2 is not involved between the 2 machines then the connection
works fine.
If, on the other hand, the requestor makes the request from behind MS Proxy
2 then the connection fails.

has anyone had a similar problem, if so, some tips on how I could get around
this problem would be good.

JV





__________________________________________________ _________________
Remotely manage MS SQL db with SQLdirector -
www.ciquery.com/tools/sqldirector/


 
Reply With Quote
 
 
 
 
Tim Jowers
Guest
Posts: n/a
 
      07-14-2003
"Jack Vamvas" <(E-Mail Removed)> wrote in message news:<besb5e$i32$(E-Mail Removed)>...
> I am currently working on a whiteboard application , that uses
> java.net.socket as the connection method.
> If MS Proxy 2 is not involved between the 2 machines then the connection
> works fine.
> If, on the other hand, the requestor makes the request from behind MS Proxy
> 2 then the connection fails.
>
> has anyone had a similar problem, if so, some tips on how I could get around
> this problem would be good.
>
> JV
>

You have to configure the proxy according to what type it is. Thank
Michael Montuori for this code...mybe you want to contract him for
some contract work


System.out.println(" -t {1|2|3|4} = 1-Sun
VM");
System.out.println("
2-Microsoft VM (Default)");
System.out.println(" 3-Cisco
PIX");
System.out.println(" 4-Socks
4 Proxy Servers");
System.out.println(" 5-Web
Ftp (default anonymous)");
....
if (proxyHost != null) {
if (proxyType.equals("1") || proxyType.equals("3")) {
System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", proxyHost);
System.getProperties().put( "proxyPort", proxyPort);
} else {
if (proxyType.equals("4")) {
System.getProperties().put( "socksProxySet",
"true");
System.getProperties().put( "socksProxyHost",
proxyHost);
System.getProperties().put( "SocksProxyPort" ,
proxyPort);
} else {
if (proxyType.equals("5")) {
System.getProperties().put( "ftpProxySet",
"true" );
System.getProperties().put( "ftpProxyHost",
proxyHost );
System.getProperties().put( "ftpProxyPort",
proxyPort );
} else {
System.getProperties().put("firewallSet",
"true");
System.getProperties().put("firewallHost",
proxyHost);
System.getProperties().put("firewallPort",
proxyPort);
System.getProperties().put("http.proxyHost",
proxyHost);
System.getProperties().put("http.proxyPort",
proxyPort);
}}}
if (https && proxyHost != null) {
System.getProperties().put("https.proxyHost",
proxyHost);
System.getProperties().put("https.proxyPort",
proxyPort);
}
}
....
if (proxyHost != null) {
Base64 base64 = new Base64(username + ":" + password);
base64.encode();
base64Encoded = "Basic " + base64.getOutgoing();
urlConnection.setRequestProperty("Proxy-Connection","Keep-Alive");
if (proxyType.equals("3")) {
urlConnection.setRequestProperty("Authorization",
base64Encoded);
} else {
urlConnection.setRequestProperty("Proxy-Authorization",
base64Encoded);
}

....
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IllegalArgumentException with Socket API and Proxy with Proxy.Type.HTTP Greg Java 4 08-16-2012 08:26 PM
Proxy pattern and java.lang.reflect.Proxy/InvocationHandler Karsten Wutzke Java 1 08-20-2007 11:05 AM
Inbound Proxy and Outbound Proxy chellappa VOIP 0 04-07-2006 10:58 AM
Press Release: Scalable SIP Proxy and RTP Media Proxy for NAT traversal sales@lanscapecorp.com VOIP 1 01-23-2006 06:32 PM
Proxy and non Proxy configurations Alejandro Molina ASP .Net Security 0 07-15-2004 05:04 AM



Advertisments