users@glassfish.java.net

WebSockets and proxy-servers

From: <forums_at_java.net>
Date: Wed, 11 May 2011 07:03:27 -0500 (CDT)

Hi,

this question could be wrong here, since it is in the grizzly part, but since
grizzly is integrated in GlassFish, perhaps someone could help...

Well, I'm using a Java (swing) client to access my server using websockets,
everything is working fine.

Now I have a task to make sure that it also works throw a proxy-server, so
after some research I know that using wss is the right thing to do. Still
evrything fine here, I can connect (directly) to my server through wss.

Now comes the problem:

How can I tell my client to use a defined proxy-server? I tried first the
Plain Old Java Procedure(c) ;)

System.setProperty("https.proxyHost", proxyHost) ;
System.setProperty("https.proxyPort", proxyPort) ;

But the client is still contacting the server directly (proxy not loggin any
connection from client).

Then I tried using the ProxySelector:

But using a Http Proxy Def is not functioning:

new Proxy(Proxy.Type.HTTP, inetSocketAddress);

When I debug the client, in my MyProxySelector.select(URI uri) I get for

uri.getScheme();

"socket" instead of Http, so registering a Proxy with Proxy.Type.HTTP is
wrong.

Why is it that the Grizzly implementation of WebSockets uses "socket"
protocol instead of http? Shouldn't WebSocket work over Http?

And most importantly how can I define a proxy-server for my connection?

Thank you in advance!

Regards,

MohamzJava


--
[Message sent by forum member 'MohamzJava']
View Post: http://forums.java.net/node/800926