public final void setproxy(String hostname,int port,String auth,boolean ftp)
{
 if (auth!=null) 
     if(ftp)
    	 ftp_proxy_auth="Proxy-authorization: Basic "+HTUU.encode_string(auth);
     else
    	 http_proxy_auth="Proxy-authorization: Basic "+HTUU.encode_string(auth);
 else 
     if(ftp)
         ftp_proxy_auth=null;
     else
    	 http_proxy_auth=null;
 try {
     if(ftp)
     {
    	 ftp_proxy=InetAddress.getByName(hostname);
    	 ftp_proxy_port=port;
     } else
     {
    	 http_proxy=InetAddress.getByName(hostname);
    	 http_proxy_port=port;
     }
 }
 catch (UnknownHostException e)
 {
	 System.err.println("[WARNING] Can not resolve parent proxy hostname: "+hostname+" - running without it.");
	 if(ftp)
	 {
		 ftp_proxy=null;
		 ftp_proxy_auth=null;
		 ftp_proxy_port=0;
	 }
	 else
	 {
		 http_proxy=null;
		 no_proxy=null;
		 http_proxy_auth=null;
		 http_proxy_port=0;
	 }
 }
}