First of all you have to know the URL and Port of your proxy, let's say:
proxy: www.proxyfoo.org
port: 80
Thus you have to set up the environment variable http_proxy (there are more possibilities setting http,ftp,proxy variables):
http_proxy=http://www.proxyfoo.org:80
Also if you are having the error "GUI framework cannot be initialized" in some IDE as WinShell, TeXnicCenter, etc. then the solution is:
Start MiKTeX Options and choose either Yes or No (but not "Ask me first") for the option "Install missing packages on-the-fly".