This discussion is archived
5 Replies Latest reply: Mar 8, 2007 1:30 AM by EJP RSS

SOCKS redirection

807597 Newbie
Currently Being Moderated
I have a SOCKS ver4 proxy server and an application that runs on SOCKS ver 4 (Yahoo Messenger). I want to create an application that will serve as a transit between the 2. Meaning, I will be creating an API that will listen to the SOCKS application and forward the data to the SOCKS server.

The problem is the java.net.ServerSocket cannot accept() connections coming from the application running on SOCKS proxy (no action is taking place during connection attempt). How do we deal with this"

Thanks,
Mark
  • 1. Re: SOCKS redirection
    EJP Guru
    Currently Being Moderated
    What do you mean 'no action is taken'?

    I suspect you've set your system up wrong. The application you're trying to write is the real SOCKS client, and the existing client is just a client of your application. So the socksProxyHost & Port should be set at the JVM of you8r new application and not at the existing client.

    But why do you want to do this at all?
  • 2. Re: SOCKS redirection
    807597 Newbie
    Currently Being Moderated
    The application I am creating would be a client to SOCKS proxy server and at the same time a proxy server to the current SOCKS proxy client application. All I want to do is to redirect all the data to the SOCKS proxy server.

    If you use the java.net.ServerSocket, it does not accept() client connection from the current SOCKS proxy client. No exception is also thrown.
  • 3. Re: SOCKS redirection
    EJP Guru
    Currently Being Moderated
    Then the client isn't connecting to it.
  • 4. Re: SOCKS redirection
    807597 Newbie
    Currently Being Moderated
    But when I change the Proxy type of the Yahoo Messenger (current Proxy client) to HTTP from SOCKS, it is able to connect to ServerSocket. When the protocol is SOCKS, it doesn't connect. Why does that happen? Thanks so much...
  • 5. Re: SOCKS redirection
    EJP Guru
    Currently Being Moderated
    The current client is a client of your new code. Either it should connect directly to your new application, or its SOCKS proxy settings should be set to point to your new application.

    If you want to get any further you'll have to specify the ports and SOCKS settings for all three elements in this setup.