Building a Web Client Using CHttpBlockingSocket
If you had written your own Internet browser program a few years ago, you could have made a billion dollars by now. But these days, you can download browsers for free, so it doesn't make sense to write one. It does make sense, however, to add Internet access features to your Windows applications. Winsock is not the best tool if you need HTTP or FTP access only, but it's a good learning tool.
The Ex28a Winsock Client
The Ex28a program implements a Winsock client in the file \vcppnet\Ex28a\

Ex28a Support for Proxy Servers
If your computer is connected to a LAN at work, chances are it's not exposed directly to the Internet but rather is connected through a proxy server. There are two kinds of proxy servers: Web and Winsock. Web proxy servers, sometimes called CERN proxies, support only the HTTP, FTP, and gopher protocols. (The gopher protocol, which predates HTTP, allows character-mode terminals to access Internet files.) A Winsock client program must be specially adapted to use a Web proxy server. A Winsock proxy server is more flexible and thus can support protocols such as RealAudio. Instead of modifying your client program source code, you link to a special remote Winsock DLL that can communicate with a Winsock proxy server.
The Ex28a client code can communicate through a Web proxy if you select the Use Web Proxy check box on the Client tab of the Configuration dialog box. In that case, you must know and enter the name of your proxy server. From that point on, the client code will connect to the proxy server instead of the real server. All GET and POST requests must then specify the full URL for the file.If you were connected directly to Consolidated Messenger's server, for example, your GET request might look like this:
GET /customers/newproductsl HTTP/1.0
But if you were connected through a Web proxy server, the GET would look like this:
GET http://consolidatedmessenger.com/customers/newproductsl HTTP/1.0
Testing the Ex28a Winsock Client
The easiest way to test the Winsock client is by using the built-in Winsock server. Just start the server as before, and then choose Request (Winsock) from the Internet menu. You should see some HTML code in a message box. You can also test the client against IIS, the server running in another Ex28a process on the same computer, the Ex28a server running on another computer on the Net, and an Internet server. Ignore the Address URL in the dialog box bar for the time being; it's for one of the WinInet clients. You must enter the server name and filename on the Client tab of the Configuration dialog box.