Java 类org.jivesoftware.smack.proxy.ProxyInfo.ProxyType 实例源码

项目:aceim    文件:XMPPServiceInternal.java   
private ProxyType getProxyType(String proxyType) {
    if (proxyType.equalsIgnoreCase("http")) {
        return ProxyType.HTTP;
    } else if (proxyType.equalsIgnoreCase("socks4")) {
        return ProxyType.SOCKS4;
    } else if (proxyType.equalsIgnoreCase("socks5")) {
        return ProxyType.SOCKS5;
    }
    return ProxyType.NONE;
}
项目:Beem    文件:BeemService.java   
/**
    * Get the save proxy configuration.
    *
    * @return the proxy configuration
    */
   private ProxyInfo getProxyConfiguration() {
boolean useProxy = mSettings.getBoolean(BeemApplication.PROXY_USE_KEY, false);
if (useProxy) {
    String stype = mSettings.getString(BeemApplication.PROXY_TYPE_KEY, "HTTP");
    String phost = mSettings.getString(BeemApplication.PROXY_SERVER_KEY, "");
    String puser = mSettings.getString(BeemApplication.PROXY_USERNAME_KEY, "");
    String ppass = mSettings.getString(BeemApplication.PROXY_PASSWORD_KEY, "");
    int pport = Integer.parseInt(mSettings.getString(BeemApplication.PROXY_PORT_KEY, "1080"));
    ProxyInfo.ProxyType type = ProxyType.valueOf(stype);
    return new ProxyInfo(type, phost, pport, puser, ppass);
} else {
    return ProxyInfo.forNoProxy();
}
   }
项目:beem-fork-xmpp    文件:BeemService.java   
/**
    * Get the save proxy configuration.
    *
    * @return the proxy configuration
    */
   private ProxyInfo getProxyConfiguration() {
boolean useProxy = mSettings.getBoolean(BeemApplication.PROXY_USE_KEY, false);
if (useProxy) {
    String stype = mSettings.getString(BeemApplication.PROXY_TYPE_KEY, "HTTP");
    String phost = mSettings.getString(BeemApplication.PROXY_SERVER_KEY, "");
    String puser = mSettings.getString(BeemApplication.PROXY_USERNAME_KEY, "");
    String ppass = mSettings.getString(BeemApplication.PROXY_PASSWORD_KEY, "");
    int pport = Integer.parseInt(mSettings.getString(BeemApplication.PROXY_PORT_KEY, "1080"));
    ProxyInfo.ProxyType type = ProxyType.valueOf(stype);
    return new ProxyInfo(type, phost, pport, puser, ppass);
} else {
    return ProxyInfo.forNoProxy();
}
   }