Started working on an HTTP-specific proxy. Harder than I initially thought. One connection can have multiple destinations. Have to look at each HTTP request and pull out the "Host: " header to find out where the message is supposed to go. I then have to set up a stream copier for that destination, if one doesn't already exist.
Got HTTP to work. Had to install a custom accept listener and connection handler. The connection handler peeks into the HTTP headers to determine what the destination address is. Once it knows the destination it either creates or reuses a connection to that server. Since we don't know the destination until late, the server-to-client copier is created while copying the data during the client-to-server phase.
HTTPS does not work. Instead of sending a GET request, HTTPS uses CONNECT. Need to figure out how to handle HTTPS traffic.
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment