You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by lichunlei <li...@cyberobject.com> on 2007/05/15 11:13:37 UTC

How to set socket proxy in Mina?

Sir,

     Our company is using Mina to develop a project.

Our socket Server program is hinding a firewall, so our client have to use a
socket proxy to visit server.

But I don't know how to use socket proxy in mina?

It takes three days to this trouble.

If there is not a good method to deal with the problem, we will have to give
up mina.

Below is our code for connecting to server:

 

     private static final String HOSTNAME = "130.208.0.77";

          private static final int PORT = 5678;

           

           //set socket proxy

           String proxyHost = "192.168.0.76";

           String proxyPort = "1080";           

           System.getProperties().put("socksProxySet","true");

           System.getProperties().put("socksProxyHost",proxyHost);

           System.getProperties().put("socksProxyPort",proxyPort); 

 

     SocketConnector connector = new SocketConnector(); 

     SocketConnectorConfig cfg = new SocketConnectorConfig();

        

    cfg.getFilterChain().addLast(

                "codec",

                new ProtocolCodecFilter( new HostProtocolCodecFactory()));

        

     ConnectFuture future = connector.connect(new InetSocketAddress(
HOSTNAME, PORT),  new ClientSessionHandler(), cfg );  

     future.join();

 

But future.isConnected() is false.

I want to know how to set socket proxy in Mina?

Best Regard!

 


Re: How to set socket proxy in Mina?

Posted by peter royal <pr...@apache.org>.
On May 15, 2007, at 2:13 AM, lichunlei wrote:
> Our socket Server program is hinding a firewall, so our client have  
> to use a
> socket proxy to visit server.
>
> But I don't know how to use socket proxy in mina?
>
> It takes three days to this trouble.
>
> If there is not a good method to deal with the problem, we will  
> have to give
> up mina.

alas, java's NIO doesn't support SOCKS proxies afaik.
-pete


-- 
proyal@apache.org - http://fotap.org/~osi