Programming Assignment #3 , Milestone HW3.C
Overview
Proxies operate in a great position to act as 'translators' between
two hosts or programs that can't talk to eachother directly- so in Milestone
3, you'll be changing your proxy to act as a 'translator' between a client that
speaks only STCP, and a server that is running on a standard TCP implimentation.
As shown in the image below, your proxy will continue to use the standard TCP/IP
sockets library to speak to the various remote servers that you'll talk to. However,
messages from HTTP clients will be sent to the proxy using STCP as the transport layer.
A simple, wget-like STCP HTTP client is provided for you in the source tarball that you
downloaded for assignment 3.
Changes needed to be made to your web proxy for milestone#3
You only need to change the way that your proxy works on the server (passive)
side! You'll continue to use standard TCP/IP and the standard sockets
libraries to speak with remote servers- no changes should be needed to the active
connection side.
To get your proxy working with the STCP-based client, you'll need to do the following:
- You should change the relevant socket(AF_INET,...) calls in your code to mysocket().
- Use the interface in mysock.c rather than the
system call socket interface for the relevant sockes. Thus you should prefix calls
to accept, bind, listen, etc. by the word "my".
- The mysocket() function takes one
argument (is_reliable). You should make sure your web proxy allows
an optional argument (-U) and if the user specifies this option,
you should pass it appropriately to any mysocket() calls.
If this argument is specified, it will always be immediately after the
name of the program, i.e. it will always be in argv[1], if -U is
specified at all. The remaining arguments remain the same.
Miscellaneous notes about milestone #3
- If you use your version of the web proxy for this part of the
assignment, you should be able to just list your additional source
files under "PROXY_SRCS" in the provided Makefile.