Package net.sourceforge.jsocks.socks

Examples of net.sourceforge.jsocks.socks.Proxy


      "Usage: java Testclient testhost proxy [directhosts]");
   }

   static Proxy initProxy(String ps){
      java.util.StringTokenizer st = new java.util.StringTokenizer(ps,",;");
      Proxy proxy = null;
      while(st.hasMoreElements()){
         String entry = st.nextToken();
         Proxy p = Proxy.parseProxy(entry);
         if( p == null){
           log("Proxy "+entry+" invalid.");
           return null;
         }
         p.setChainProxy(proxy);
         proxy = p;
      }
      return proxy;
   }
View Full Code Here


      String testHost = argv[0];
      String proxyHost = argv[1];
      String directHosts = argv.length >2 ? argv[2] : null;

      Proxy p = initProxy(proxyHost);
      if(p == null){
         log("Can't init proxy.");
         return;
      }
      if(directHosts!=null) addDirectHosts(p,directHosts);
View Full Code Here

   private void onClear(){
      output_textarea.setText("");
   }
   private void onProxy(){
      Proxy p;
      p = socks_dialog.getProxy(proxy);
      if(p != null) proxy = p;
      if( proxy != null && proxy instanceof Socks5Proxy)
         ((Socks5Proxy) proxy).resolveAddrLocally(false);
   }
View Full Code Here

   /**
     Initialises proxy, if any specified.
   */
   static void proxyInit(Properties props){
      String proxy_list;
      Proxy proxy = null;
      StringTokenizer st;

      proxy_list = (String) props.get("proxy");
      if(proxy_list == null) return;

      st = new StringTokenizer(proxy_list,";");
      while(st.hasMoreTokens()){
         String proxy_entry = st.nextToken();

         Proxy p = Proxy.parseProxy(proxy_entry);

         if(p == null)
            exit("Can't parse proxy entry:"+proxy_entry);
       

         inform("Adding Proxy:"+p);

         if(proxy != null)
            p.setChainProxy(proxy);

         proxy = p;

      }
      if(proxy == null) return//Empty list
View Full Code Here

TOP

Related Classes of net.sourceforge.jsocks.socks.Proxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.