Ignore:
Timestamp:
09/21/09 14:39:41 (15 years ago)
Author:
alexandrecorreia
Message:

Ticket #588 - Conexão através do proxy ( Squid ) , utilizando mode Digest e Basic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/jabberit_messenger/java_source/src/nu/fw/jeti/backend/LoginInfo.java

    r1014 r1424  
    3030 
    3131import nu.fw.jeti.util.Utils; 
     32 
    3233 
    3334/** 
     
    4849        private String resource; 
    4950        private String password; 
    50         private boolean useJavaProxy=true; 
    5151        private boolean ssl=false; 
    5252        private int proxyType=NO_PROXY; 
     
    5454        private String proxyPort; 
    5555        private String proxyUsername; 
    56         private String proxyPassword;  //encrypt? 
     56        private String proxyPassword;  
    5757        private int priority; 
    5858 
    5959        //applet 
    60     public LoginInfo(String server, String host, String username, 
    61                      String password, String resource,int port,boolean ssl,int priority) 
    62     { 
    63         if( username != null && username.indexOf("@") !=-1 ) 
     60    public LoginInfo(String server, String host, String username,String password, 
     61                String resource,int port,boolean ssl,int priority) 
     62    { 
     63        if(username!=null && username.indexOf("@")!=-1 ) 
    6464        { 
    6565                this.host = server; 
     
    8585    } 
    8686 
    87         public LoginInfo(String server, String host, String username, 
    88             String password, String resource,int port, boolean ssl,int priority, 
    89             boolean useProxy) 
    90         { 
    91                  this(server,host,username,password,resource,port,ssl,priority); 
    92                  this.useJavaProxy = useProxy; 
    93         } 
    94  
    95         public LoginInfo(String server, String host, String username, 
     87    public LoginInfo(String server, String host, String username, 
    9688                     String password, String resource,int port, boolean ssl,int priority, 
    9789                     int proxy, String proxyServer, String proxyUsername, 
    98                      String proxyPassword, String proxyPort) 
     90                     String proxyPassword, String proxyPort ) 
    9991    { 
    10092        this(server,host,username,password,resource,port,ssl,priority); 
     
    10698    } 
    10799 
     100    public LoginInfo(String server, String host, String username, String password, String resource, 
     101                                 int port, boolean ssl, String proxyServer, String proxyPort) 
     102    { 
     103        this.server = server; 
     104        this.host = host; 
     105        this.username = username; 
     106        this.password = password; 
     107        this.resource = resource; 
     108        this.port = port; 
     109        this.ssl = ssl; 
     110        this.proxyServer = proxyServer; 
     111        this.proxyPort = proxyPort; 
     112    } 
     113     
    108114        /** 
    109115         * Returns the port. 
     
    143149 
    144150    /** 
    145      * Returns the useJavaProxy. 
    146      * @return boolean 
    147      */ 
    148     public boolean getJavaProxy() 
    149     { 
    150         return useJavaProxy; 
    151     } 
    152      
    153     /** 
    154151         * Returns the ssl. 
    155152         * @return boolean 
     
    190187        } 
    191188 
     189        public void setProxyPassword(String proxyPassword) 
     190        { 
     191                this.proxyPassword = proxyPassword; 
     192        } 
     193         
    192194        /** 
    193195         * Returns the proxyPassword. 
     
    217219        } 
    218220 
     221        /** 
     222         * Set the proxyUsername; 
     223         *  
     224         */ 
     225         
     226        public void setProxyUsername(String proxyUsername) 
     227        { 
     228                this.proxyUsername = proxyUsername; 
     229        } 
     230         
    219231        /** 
    220232         * Returns the proxyUsername. 
     
    247259        public boolean isHTTPProxy() 
    248260        { 
     261                //System.out.println( "( " + proxyType + "==" + LoginInfo.HTTP_PROXY + " ) = " + useProxy(LoginInfo.HTTP_PROXY)); 
     262                 
    249263                if( useProxy(LoginInfo.HTTP_PROXY) )  
    250264                        return true; 
    251  
    252                 if( Start.applet ) 
    253                 { 
    254                         try 
    255                         { 
    256                                 ProxyInfo info[] = ProxyService.getProxyInfo(new URL("http://www.google.com.br")); 
    257                                  
    258                                 if (info != null && info.length > 0 ) 
    259                                 { 
    260                                         proxyType = HTTP_PROXY; 
    261                                         proxyServer = info[0].getHost(); 
    262                                         proxyPort = String.valueOf(info[0].getPort()); 
    263                                         return true; 
    264                                 } 
    265  
    266                         } 
    267                         catch (Exception ex) 
    268                         { 
    269                                 System.err.println("could not retrieve proxy configuration, attempting direct connection."); 
    270                         } 
    271                 } 
    272                 return false; 
    273         } 
    274  
     265                else 
     266                        return false; 
     267        } 
    275268} 
    276269/* 
Note: See TracChangeset for help on using the changeset viewer.