Java Reference
In-Depth Information
ever understand these one-of-a-kind protocols. Consequently, some developers have
taken to tunneling their protocols through HTTP, most notably with SOAP. However,
this has a significant negative impact on security. The firewall is normally there for a
reason, not just to annoy Java programmers.
Applets that run in web browsers normally use the proxy server settings of the web
browser itself, though these can be overridden in the Java Control Panel. Standalone
Java applications can indicate the proxy server to use by setting the socksProxyHost
and socksProxyPort properties (if you're using a SOCKS proxy server), or
http.proxySet , http.proxyHost , http.proxyPort , https.proxySet , https.proxy
Host , https.proxyPort , ftpProxySet , ftpProxyHost , ftpProxyPort , gopherProxy
Set , gopherProxyHost , and gopherProxyPort system properties (if you're using
protocol-specific proxies). You can set system properties from the command line using
the -D flag, like this:
java -DsocksProxyHost= socks.cloud9.net -DsocksProxyPort= 1080 MyClass
The Client/Server Model
Most modern network programming is based on a client/server model. A client/server
application typically stores large quantities of data on an expensive, high-powered server
or cloud of servers while most of the program logic and the user interface is handled by
client software running on relatively cheap personal computers. In most cases, a server
primarily sends data while a client primarily receives it; but it is rare for one program
to send or receive exclusively. A more reliable distinction is that a client initiates a
conversation while a server waits for clients to start conversations with it. Figure 1-5
illustrates both possibilities. In some cases, the same program may be both a client and
a server.
You are already familiar with many examples of client/server systems. In 2013, the most
popular client/server system on the Internet is the Web. Web servers like Apache re‐
spond to requests from web clients like Firefox. Data is stored on the web server and is
sent out to the clients that request it. Aside from the initial request for a page, almost
all data is transferred from the server to the client, not from the client to the server. FTP
is an older service that fits the client/server model. FTP uses different application pro‐
tocols and different software, but is still split into FTP servers that send files and FTP
clients that receive files. People often use FTP to upload files from the client to the server,
so it's harder to say that the data transfer is primarily in one direction, but it is still true
that an FTP client initiates the connection and the FTP server responds.
Search WWH ::




Custom Search