proxy : Java Glossary
home P words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
CurrCon neededThe CurrCon Java Applet displays prices on this web page converted with today’s exchange rates into your local international currency, e.g. Euros, US dollars, Canadian dollars, British Pounds, Indian Rupees… CurrCon requires Java 1.1 or later, preferably 1.6.0_07 . If you can’t see the prices, of you if just want to learn more about CurrCon, click here for help.
proxy
A server that stands between your machine and the potentially hostile world of the Internet. Instead of directly asking machines on the Internet to do things for you, you ask the proxy server to ask on your behalf. In return for this loss of directness and freedom, the proxy web and ftp servers may cache your pages and data resulting in faster access. If the proxy implements a firewall it also attempts to protect you from the hostile world, and your own stupidity. A proxy makes a group of users behind the firewall look like a single very active user to the outside world. It makes all its requests of the Internet via a single IP. When results come back, it remembers who internally was talking to that external site. The advantage of this is you do not need to rent a permanent IP for each user (about $10.00 CAD /month each) on your ADSL or cable modem connection. All users share one IP.

When proxy servers interfere with your Applets, sometimes changing DNS names to IP names in the URLs or CODEBASE parms helps, e.g. codebase="http://mindprod.com/" to codebase="http://65.110.21.43/". Why does something so off-the-wall work? It helps the security manager determine that you truly are talking only to the host you were loaded from. The security manager has access only to the proxy’s brain-damaged or non-existent DNS services.

There are two Java system properties http.proxyHost=proxyhost http.proxyHost=proxyhost and http.proxyPort=portNumber you can set in the standard way with the java.exe -D command line switch. They had different names without the http. in JDK 1.2-.

You often have the option of using a proxy server or bypassing it. For example, in your browser, you can configure the IP or DNS name of your proxy server and then your browser will talk only to it. If you erase that entry, then it will talk directly to the websites you browse. You may also configure a default proxy server in the operating system that all apps are requested to use. They may or may not take its advice.

Before you do your GET or POST, you can use code like this to set the System properties that cause HttpURLConnection to do the right thing for proxies.

System.setProperty( "proxySet", "true" );
System.setProperty( "http.proxyHost", proxyHostName );
System.setProperty( "http.proxyPort", Integer.toString( proxyHostPort ) );

Proxy Design Pattern

Proxy is also one of the design patterns also known as surrogate. It means using a stand-in object for the original object. When you call the methods of the proxy, it calls the corresponding methods of the original object. Why would you do this? Proxies can be implemented two ways:
  1. Implemented with tiny wrapper methods (sometimes mechanically generated) that call the original method. This is how RMI works. The advantage of this approach is small proxy objects. The disadvantage is the hassle of generating and maintaining the proxy wrapper methods and making sure they stay in sync with the original objects.
  2. Implemented with smart accessors that first find the correct object before doing any useful work. This is how the Objectstore POD works. Methods in the original class must first call a finder method to set an aRealObject reference, then do all their work via that handle. The base class dummy finder method is aRealObject = this; to make methods work on the base object. Nearly all the code goes in the base class. You need to write only an overriding finder method for each proxy type. The advantage of this method is ease of maintenance. You don’t have to write wrappers and ensure every method that needs one is wrapped with the precisely correct signature. The disadvantage is even direct use of the original object pays a small overhead of using a dummy finder method.

Proxy Authentication

Some proxy servers require authentication (logon to keep unauthorised users out). This is done in a fashion very similar to normal HTTP authorisation, but instead of using WWW-Authenticate and Authorization, headers, the authentication handshake uses Proxy-Authenticate and Proxy-Authorization. The java.net.Authenticator class is used to obtain the proxy credentials for the connection.

JDK 1.4.2 introduced support for the NTLM authentication protocol on Windows platforms, which is a proprietary Microsoft authentication scheme (often used in corporate settings for Windows domain-based authentication with IIS, and proxy authentication with ISA proxy servers). You typically need to additionally set the http.auth.ntlm.domain property to specify the domain in which the account resides.

Sun’s JDK Technote Guide on Authentication : available:

The jCIFS library provides this functionality to Unix clients as well; it also has an NTLM filter which allows your servlets to authenticate using NTLM (acting as the server side of NTLM). NTLM authentication is used throughout Windows network implementations, including connections to shared drives (which the jCIFS library also provides).


CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.16] The information on this page is for non-military use only.
You are visitor number 26,991. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/proxy.html J:\mindprod\jgloss\proxy.html