Web Services using a TCP proxy server (Part 3 of 3)
Last edited 2007-06-25 by Jay Nelson

This tutorial demonstrates a simple, but non-trivial, example of a TCP proxy server using the OTP construct gen_server. The goal is to implement a process that can be used to deliver web services to HTML browsers. The source code is here.

This tutorial contains three parts:

  1. A generic TCP proxy server based on gen_server
  2. How to implement the ProxyModule interface
  3. A Web Service using the TCP proxy server

Please, report all errors, omissions or improvements to the author.

  1. Description of a proxy server
    1. The proxy server interface
    2. The gen_server behaviour
    3. Architecting a server design
    4. Implementing gen_server callbacks
    5. Implementing the Accept Connection process
  2. Implementing the ProxyModule interface
    1. ProxyModule explained
    2. Testing with an echo proxy server
    3. Echoing a browser request
    4. A proxy server to block websites
  3. Deploying Web Services
    1. Recognizing requests
    2. Extracting from web pages
      1. Synonym dictionary
      2. Pattern matching dictionary
      3. Zoning a page
      4. Pulling content from a zone
    3. Reconstructing web pages

3 Deploying Web Services

This part of the tutorial will be written in the first half of 2008. The technology needed to build and explain it simply has not been completed yet.