Search in sources :

Example 1 with ProxySOCKS4

use of com.jcraft.jsch.ProxySOCKS4 in project spring-integration by spring-projects.

the class JschProxyFactoryBean method createInstance.

@Override
protected Proxy createInstance() throws Exception {
    switch(this.type) {
        case SOCKS5:
            ProxySOCKS5 socks5proxy = new ProxySOCKS5(this.host, this.port);
            socks5proxy.setUserPasswd(this.user, this.password);
            return socks5proxy;
        case SOCKS4:
            ProxySOCKS4 socks4proxy = new ProxySOCKS4(this.host, this.port);
            socks4proxy.setUserPasswd(this.user, this.password);
            return socks4proxy;
        case HTTP:
            ProxyHTTP httpProxy = new ProxyHTTP(this.host, this.port);
            httpProxy.setUserPasswd(this.user, this.password);
            return httpProxy;
        default:
            throw new IllegalArgumentException("Invalid type:" + this.type);
    }
}
Also used : ProxySOCKS4(com.jcraft.jsch.ProxySOCKS4) ProxySOCKS5(com.jcraft.jsch.ProxySOCKS5) ProxyHTTP(com.jcraft.jsch.ProxyHTTP)

Aggregations

ProxyHTTP (com.jcraft.jsch.ProxyHTTP)1 ProxySOCKS4 (com.jcraft.jsch.ProxySOCKS4)1 ProxySOCKS5 (com.jcraft.jsch.ProxySOCKS5)1