Code example for Socket

Methods: getInputStreamgetLocalAddressgetLocalPortgetOutputStream

0
   public SocksTest(String host,int port) 
	  throws IOException,UnknownHostException,SocksException{ 
      this.port = port;
 
      ss = new SocksSocket(host, port);
      out = ss.getOutputStream();
      in  = ss.getInputStream();
      System.out.println("Connected...");
      System.out.println("TO: "+host+":"+port);
      System.out.println("ViaProxy: "+ss.getLocalAddress().getHostAddress()
                                 +":"+ss.getLocalPort());
 
   } 
 
   public void close()throws IOException{ 
     ss.close();
   } 
   public void send(String s) throws IOException{
      out.write(s.getBytes());
   } 
Connect your IDE to all the code out there  Get Codota for Java