Software Download on CLI through Proxy

If you work behind a proxy and want to download software from the command line on OS X you will run into troubles. Fortunately there are options for proxy configuration

(Follow up to my article Installing PEAR on OS X Lion)

Curl has its own option to set a proxy even with authentication

Excerpt from man page:

curl -x, --proxy <[protocol://][user@password]proxyhost[:port]>

Example for non-authenticated proxy:

curl --proxy 192.168.1.2:8080 http://pear.php.net/go-pear.phar > go-pear.php

If you work with the fabulous InstaDMG for creating OS X images for deployment you can set an environment variable in your shell like this:

for bash, sh and related shells

export HTTP_PROXY=192.168.1.2:8080

for csh and related shells

setenv HTTP_PROXY 192.168.1.2:8080

or just add it to your .profile

Veröffentlicht von

Ruggero De Pellegrini

PHOTOGRAPHER, DEVELOPER & INDIVIDUALIST

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.