participate


Networking - Where to debug the reason why the app bypasses the socks proxy
<<   Back to Forum  |   Give us Feedback
5 Duke Stars available
This topic has 12 replies on 1 page.
sleepy_11
Posts:12
Registered: 8/7/06
Where to debug the reason why the app bypasses the socks proxy   
Aug 7, 2006 7:31 PM

 
I set the the socksProxyPort, socksProxyHost and even socksProxySet to the proper value, but my client app still tries to connect to the server directly instead of the proxy.

it happens after we upgrade the jre from 1.4.2 to 1.5.0.

There is no way to find out why such stuff happens even when i read the jdk source. ......make me insane......

Would you please tell me where or by which tool, i can find out the root cause? Thx in advance
 
ejp
Posts:27,679
Registered: 5/11/97
Re: Where to debug the reason why the app bypasses the socks proxy   
Aug 7, 2006 8:22 PM (reply 1 of 12)  (In reply to original post )

 
I think Sun broke this badly in 1.5. Try using new Socket(Proxy).

BTW socksProxySet does nothing, and neither does xxxProxySet for any xxx
 
sleepy_11
Posts:12
Registered: 8/7/06
Re: Where to debug the reason why the app bypasses the socks proxy   
Aug 7, 2006 8:55 PM (reply 2 of 12)  (In reply to #1 )

 
Thanks for your response. But unfortunately, the client connects the server through a CORBA channel, a kind of lib stuff, which initialize the socket and can not be updated by us....... :-(........

That's why i have to make the proxy working......
 
ejp
Posts:27,679
Registered: 5/11/97
Re: Where to debug the reason why the app bypasses the socks proxy   
Aug 7, 2006 8:58 PM (reply 3 of 12)  (In reply to #2 )

 
Hmm this is sad, you might have to write a CORBA socket factory. Don't ask me how.
 
sleepy_11
Posts:12
Registered: 8/7/06
Re: Where to debug the reason why the app bypasses the socks proxy   
Aug 7, 2006 10:04 PM (reply 4 of 12)  (In reply to #3 )

 
Thanks for your kind help.... :-)....

the "new Socket(proxy)" is new to the 1.5, i am afraid that my lib is based on 1.4 or earlier.....

And just sad for there is no way to seek it more..... have any idea about where JVM use the two property, "socksProxyHost" and "socksProxyPort".....
 
ejp
Posts:27,679
Registered: 5/11/97
Re: Where to debug the reason why the app bypasses the socks proxy   
Aug 7, 2006 10:13 PM (reply 5 of 12)  (In reply to #4 )

 
java.net.SocksSocketImpl, or java.net.PlainSocketImpl, can't remember which, and it changed somewhere along the line.

If you've upgraded to 1.5 why are you still worried about 1.4?
 
sleepy_11
Posts:12
Registered: 8/7/06
Re: Where to debug the reason why the app bypasses the socks proxy   
Aug 7, 2006 10:36 PM (reply 6 of 12)  (In reply to #5 )

 
my issue is after i upgraded to 1.5, the app just begin to ignore the proxy setting. i have to find out why the app does such thing to me.

the SocksSocketImpl is a 1.5 new class, i will check the plain implementation class.
 
ejp
Posts:27,679
Registered: 5/11/97
Re: Where to debug the reason why the app bypasses the socks proxy   
Aug 7, 2006 10:41 PM (reply 7 of 12)  (In reply to #6 )

 
It's broken in 1.5, I told you that, so you won't find it at all there. You'll only find it in java.net.Proxy or somewhere leading from that, and you'll find it tricky to recognize because it's all broken up.

As far as I can work out, what they did was to break socksProxyHost for plain Sockets unless you use java.net.Proxy. It still works for URLs.
 
sleepy_11
Posts:12
Registered: 8/7/06
Re: Where to debug the reason why the app bypasses the socks proxy   
Aug 8, 2006 2:54 AM (reply 8 of 12)  (In reply to #7 )

 
Thing goes uglier here....

I find out that the two ENV works in the app. If i make a new socket(host, port), it will go to the socks tunnel as i expect. But even after it, the corba still can not see the SOCKS server when i initial it.......

What is the hell going on here.......
 
ejp
Posts:27,679
Registered: 5/11/97
Re: Where to debug the reason why the app bypasses the socks proxy      
Aug 8, 2006 3:27 AM (reply 9 of 12)  (In reply to #8 )

 
Are you setting socksProxyHost early enough in the life of the application that it is there when CORBA goes to create a Socket?
 
sleepy_11
Posts:12
Registered: 8/7/06
Re: Where to debug the reason why the app bypasses the socks proxy   
Aug 8, 2006 8:43 PM (reply 10 of 12)  (In reply to #9 )

 
The application starts from a JNLP file, I add the two parameters in it.......

I think it is the start point of load the JVM......and also i can not find anywhere earlier than here. :-).....But it still does not work...
 
sleepy_11
Posts:12
Registered: 8/7/06
Re: Where to debug the reason why the app bypasses the socks proxy   
Aug 22, 2006 4:41 AM (reply 11 of 12)  (In reply to #9 )

 
The ORB initialization is implemented by SocketChannel, which does not support proxy. Some internal parameters can be set to switch to "Socket".
 
pier
Posts:2
Registered: 6/21/07
Re: Where to debug the reason why the app bypasses the socks proxy   
Jun 24, 2007 6:16 PM (reply 12 of 12)  (In reply to #11 )

 
Well, this is an old thread, but I case anyone is looking it up in the archive, I've been struggling
with the same problem. SocketChannel does not appear to use proxies, though Socket still does.

The solution is to initialize the ORB like this:

Properties props = new Properties();
props.setProperty("com.sun.CORBA.transport.ORBConnectionSocketType", "Socket");

ORB orb = ORB.init(new String[0], props);

Then it will use good old Sockets, which do obey the proxy.

But this is not a complete solution. My app still seems to occaisionally use SocketChannels, and
there seems to be a deadlock problem is a CORBA call hangs or fails.
 
This topic has 12 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 28
  • Guests : 133

About Sun forums
  • Oracle Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Oracle Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums