wget
on the command line. wget
is a command line http client, which simply fetches the document pointed to by a supplied URL. For example, =wget http://www.google.com= fetches Google's front page, and stores it in a local file.
To configure wget to use a proxy, simply set the environment variable http_proxy
to point to your proxy, like this export http_proxy=http://localhost:8080
, for example. This will redirect all wget requests to port 8080 on the local machine, which is then responsible for servicing the request however it sees fit. Try it out by starting an nc
server listening on that port and then issuing a request with wget
. You should see the HTTP request on the nc
console. You can also type in a response on the nc
console and hit ctrl-d
if you'd like.
For browsers, proxy settings differ between browsers and OS'es. Look up the http proxy settings, and point it at localhost port 8080 to get the same effect in a browser. In OS X, I use Firefox, which allows me to use a "manual" proxy setting - there's something wrong with the system proxy settings on my machine.
Note, however, that browsers have fairly specific and complex requirements on proxy operations. In particular, browsers expect persistent connections to their proxies, which complicates things. For this homework, we focus on evaluation with wget
.
wget http://www.google.com2. Server failures
wget http://hostdoesnotexist.cs.uic.edu/ wget http://words.cs.uic.edu/doesnothaveawebserver/3. Start a bogus web server on port 9090:
nc -l 9090 wget http://localhost:9090/ & sleep 1; time wget http://www.google.com;This should report a very short time to fetch google.com, not block awaiting the response from the bogus server. 4. Anonymization (sort of): Start a packet capture with Wireshark or tcpdump, then fetch http://www.google.com with a browser configured to use the proxy. There should be no Cookie: headers in the request going to google, and the User-Agent should contain the word CS361. </verbatim>
hw7
. Copyright 2016 The Board of Trustees of the University of Illinois.webmaster@cs.uic.edu |
WISEST Helping Women Faculty Advance Funded by NSF | ![]() | ![]() |