barnskilinux

Tuesday, April 05, 2005

From Using apt-get through a Proxy:

True to the tradition of standardized variables, the one big thing you need to know to make this work is $http_proxy. $http_proxy is an environmental variable that is used by all sorts of well known programs, such as lynx and wget. The simplest way of taking advantage of this little wonder is to set or define it. In bash, we do it like this:

$ export http_proxy='http://server:port'

If your lucky enough to have a proper proxy setup, you might be able to pass the login and password via the URL and save yourself a step. The syntax is pretty straight forward:

$ export http_proxy='http://user:password@server:port'

Now that we've got that pesky variable squared away, we can move on to getting the proxy to recognize us as an authenticated user by logging in. Firing up lynx, after first checking to make sure our variable is properly set (echo $http_proxy), we try to hit an innocent site like Google. If all went well, we should be presented with the proxy page screaming for our user name and password, lest they send the fifth horsemen after us to gnaw on our shoulders. Enter in the required information and proceed as if everything were as normal as rain in the gutter, while opening another xterm.

The moment of truth has arrived, for if our amazing feats of hackery succeeded in the goals we set out to achieve, we will receive the gift from the gods, the holy deb files."

SchoolTool - The SchoolTool Project