Specify which proxy to use for FTP connections.

@param ftpProxy the proxy host, expected format is <code>hostname.com:1234</code>
@return reference to self
497252
public Proxy setFtpProxy(String ftpProxy) {
    verifyProxyTypeCompatibility(ProxyType.MANUAL);
    this.proxyType = ProxyType.MANUAL;
    this.ftpProxy = ftpProxy;
    return this;
  }
1232938
public void useXopAttachmentServiceWithProxy() throws Exception {

        final String serviceURI = "http://localhost:" + port + "/services/attachments";
        
        XopAttachmentService proxy = JAXRSClientFactory.create(serviceURI, 
                                                               XopAttachmentService.class);
        
        XopBean xop = createXopBean();
        
        System.out.println();
        System.out.println("Posting a XOP attachment with a proxy");
                
        XopBean xopResponse = proxy.echoXopAttachment(xop);
        
        verifyXopResponse(xop, xopResponse);
    }
375048
public static Proxy httpProxy(String host, int port) {
        return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(Objects.requireNonNull(host), port));
    }
715204
public void setProxy(Proxy proxy)
    {
        if(proxy != null)
        {
            java.net.Proxy p = new java.net.Proxy(java.net.Proxy.Type.HTTP,
                    new InetSocketAddress(proxy.getHost(), proxy.getPort()));
            client.setProxy(p);
        }
        else
            client.setProxy(java.net.Proxy.NO_PROXY);
    }
1348069
public CredentialsProvider setProxyAuthentication(ProxyConfig proxyConfig) {

		if (proxyConfig == null) {
			return null;
		}
		String username = proxyConfig.getUsername();
		String password = proxyConfig.getPassword();

		if (!username.isEmpty() && !password.isEmpty()) {
			String host = proxyConfig.getHost();
			String port = proxyConfig.getPort();
			if (!host.isEmpty() && !port.isEmpty()) {
				CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
				String domain = proxyConfig.getDomain();
				if (!domain.isEmpty()) {
					credentialsProvider.setCredentials(new AuthScope(host, Integer.parseInt(port)), new NTCredentials(username, password, host, domain));
				} else {
					credentialsProvider.setCredentials(new AuthScope(host, Integer.parseInt(port)), new UsernamePasswordCredentials(username, password));
				}
				return credentialsProvider;
			}
		}
		return null;
	}
464778
def ftp_proxy(self, value):
        
        self._verify_proxy_type_compatibility(ProxyType.MANUAL)
        self.proxyType = ProxyType.MANUAL
        self.ftpProxy = value
872621
public static ProxyInfo setProxyCfg(String host, String port, String userName, String password) {
        return new ProxyInfo(host, port, userName, password);
    }
1152900
public static <P> P proxy(Class<P> anyInterface) {
    return proxy(Interface.type(anyInterface));
  }
980026
private FTPClient createFTPConnection(GlobusURL ftpURL, boolean srcSide)
        throws Exception {

        String protocol = ftpURL.getProtocol();

        if (protocol.equalsIgnoreCase("ftp")) {

            FTPClient ftp = new FTPClient(ftpURL.getHost(),
                                          ftpURL.getPort());
            ftp.authorize(ftpURL.getUser(),
                          ftpURL.getPwd());

            return ftp;

        } else {

            GridFTPClient ftp = new GridFTPClient(ftpURL.getHost(),
                                                  ftpURL.getPort());

            if (srcSide) {
                Authorization auth = getSourceAuthorization();
                if (auth == null) {
                    auth = HostAuthorization.getInstance();
                }
                ftp.setAuthorization(auth);
                ftp.authenticate(getSourceCredentials());
            } else {
                Authorization auth = getDestinationAuthorization();
                if (auth == null) {
                    auth = HostAuthorization.getInstance();
                }
                ftp.setAuthorization(auth);
                ftp.authenticate(getDestinationCredentials());
            }

            if (tcpBufferSize != 0) {
                ftp.setTCPBufferSize(tcpBufferSize);
            }

            return ftp;
        }
    }
4821
public String getRemoteRealAddr(String realIpHeader) {
        String host = getProxyRemoteAddr(realIpHeader);
        if (host == null || host.equals("unknown")) {
            host = getRemoteAddr();
        }

        return host;
    }
28817
@SuppressWarnings("deprecation")
	public Proxy getProxy(Proxy p) {
		if (p != null) {
			doInit(p);
		}
		mode = COMMAND_MODE;
		pack();
		show();
		return proxy;
	}
678430
public String remoteIP(){
        String remoteAddr = request.getRemoteAddr();
        
        // This could be a list of proxy IPs, which the developer could
        // provide via some configuration
        if ("127.0.0.1".equals(remoteAddr)) remoteAddr = requestHeader("X-Forwarded-For");
        return remoteAddr;
    }
1202825
@Override
   public HotRodServerConfigurationBuilder proxyHost(String proxyHost) {
      attributes.attribute(PROXY_HOST).set(proxyHost);
      return this;
   }
393191
public final J4pClientBuilder useProxyFromEnvironment(){
        Map<String, String> env = System.getenv();
        for (String key : env.keySet()) {
            if (key.equalsIgnoreCase("http_proxy")){
                httpProxy = parseProxySettings(env.get(key));
                break;
            }
        }
        return this;
    }
1292510
public <T> T getClientProxy(final Bean<T> bean, Type requestedType) {
        // let's first try to use the proxy that implements all the bean types
        T proxy = beanTypeClosureProxyPool.getCastValue(bean);
        if (proxy == BEAN_NOT_PROXYABLE_MARKER) {
            /*
             *  the bean may have a type that is not proxyable - this is not a problem as long as the unproxyable
             *  type is not in the type closure of the requested type
             *  https://issues.jboss.org/browse/WELD-1052
             */
            proxy = requestedTypeClosureProxyPool.getCastValue(new RequestedTypeHolder(requestedType, bean));
            if (proxy == BEAN_NOT_PROXYABLE_MARKER) {
                throw Proxies.getUnproxyableTypeException(requestedType, services());
            }
        }
        BeanLogger.LOG.lookedUpClientProxy(proxy.getClass(), bean);
        return proxy;
    }
1149951
public void setProxy(URI proxy) {
        this.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(proxy.getHost(), proxy.getPort(), proxy.getScheme()));
    }
147426
public static <C> C getProxy(final Class<C> configInterface)
    {
        return getProxy(configInterface, Optional.empty());
    }