ECS 152A: Computer Networks

Project 1

HTTP Proxy Server on Android Platform

Please read all sections of this document before you begin coding.

In this project, you will develop software similar to HTTP proxy server. The server would listen on a certain port for incoming HTTP requests. A TCP connection is established for each client with HTTP request and forward the HTTP request to its desired destination. The novel aspect of this project is that the proxy server will run on the Android platform, as a Android application. Your software will utilize Android framework to provide a UI interface where a user can set the desired server port number and possibly other parameters.

Objectives

The primary goal of this project is to understand basic socket programming to send information across TCP connections, as well as the basic idea of multi-thread programming. You will be introduced to the basic of Android development, you will take a peek into the HTTP protocol.

As mentioned above, you will implement a server that accepts HTTP requests. You are encouraged to come up with your own implementation as long as it can server multiple clients simultaneously.

Guidelines
Please work on this project individually. Code sharing and group work are forbidden. Offenders will be dealt with appropriately (see the policy information sheet from the class home page). Source code will be compared using MOSS.

You are required to make sure that your programs compile and run. Programs suffering compiling errors when tested by the TA will earn no credit.

Please document your code. Use meaningful names for variables and follow other style guidelines that enhance the clarity of your code.

Follow the guidelines in the “Hand In” section below when turning this assignment.

Develop and Debug: You are encourage to read the the Android Dev Guide before you proceed. There are several helpful tutorials. For example (

To debug the software in an emulator, it is helpful to read the following article:

It is highly recommended for you to use Eclipse with Android development plug-in, this instruction is in the above links.

Specification

For your Android program, please use Android 1.5 as your build target. Please make sure your project is runnable on the emulator of SDK 1.6.

Main UI: On your program's main UI, you will have the user specify the port number on which incoming HTTP requests are accepted, and UI elements similar to a button to start the service.

Each elements of your UI should indicate that what it is for. Make sure a non-computer-savvy user could use this software.

Service Thread: There is little requirements on how you implements this app, but you should make sure that the UI is not responsive all the time, which means do not block your main UI with any kind of expensive operations ( e.g. I/O). And again, make sure your software can handle multiple requests.

Second UI: After starting the service, a second UI will show the list of IPs of incoming clients. (This is optional, but will benefit your next project.) You should be able to stop your service on this UI.

Hand In

If you used Eclipse, please submit your workspace folder with only this one project inside. (You can make a copy of your workspace and remove other projects to submit) Otherwise submit your project folder with all the source code and the build file.

Finally, create a file README containing implementation Log. It should briefly describe and justify your design and implementation decisions, including any data structures used to support frame formats. Discuss any other interesting aspects of your implementation. As always, you should acknowledge the sources if you copied sections of your code from outside sources (even if you modified it later).