code: public void start(int port,int backlog,InetAddress localIP){
        try{
          ss = new ServerSocket(port,backlog,localIP);
          log("Starting SOCKS Proxy on:"+ss.getInetAddress().getHostAddress()+":"
                                        +ss.getLocalPort());
          while(true){
            Socket s = ss.accept();
            log("Accepted from:"+s.getInetAddress().getHostName()+":"
                                +s.getPort());
            ProxyServer ps = new ProxyServer(auth,s, agent);
            (new Thread(ps)).start();
          }
        }catch(IOException ioe){
          ioe.printStackTrace();
        }finally{
        }
     }
docs: Create a server with the specified port, listen backlog, and local
  IP address to bind to. The localIP argument can be used on a multi-homed
  host for a ServerSocket that will only accept connect requests to one of
  its addresses. If localIP is null, it will default accepting connections
  on any/all local addresses. The port must be between 0 and 65535,
  inclusive. <br>
  This methods blocks.