Skip to content

Instantly share code, notes, and snippets.

@carlosmcevilly
Last active July 12, 2024 06:13
Show Gist options
  • Save carlosmcevilly/5490160 to your computer and use it in GitHub Desktop.
Save carlosmcevilly/5490160 to your computer and use it in GitHub Desktop.
proxy settings for various clients - some very old notes
# shell
A possibly related setting is the FTP_PASSIVE_MODE=yes in dotfiles.
Not to be confused with FTP_PASSIVE=on for Net::FTP configuration
# git
git config --global https.proxy https://user:password@address:port
# also can use NTLM Authorization Proxy Server (NTLMAPS) (zip file is in my email archive)
http://ntlmaps.sourceforge.net/
# note: for https with LWP user agents, try the following:
$ENV{HTTP_PROXY} = 'http://192.168.250.11:8118/';
$ENV{HTTPS_PROXY} = '
http://192.168.250.11:8118/';
Also try reading the Crypt::SSLeay docs for more clues on this.
######### working
# curl
curl --proxy wwwgate0.company.com:1080 --proxy-user userid:password
http://www.yahoo.com/
ncftpget proxy settings are in ~/.ncftp/firewall
firewall-type=2
firewall-host=hostname.com
firewall-user=userid
firewall-password=whatever
firewall-port=21
firewall-exception-list=.foo.com,localhost,localdomain
wget
# put in .wgetrc file:
http_proxy = http://wwwproxy.foo.com:1080/
ftp_proxy = ftpproxy.foo.com:21 # ftp untested
use_proxy = on
proxy-user=userid
proxy-passwd=passwd
no-proxy=.foo.com
# Also must set environment variable WGETRC to point to the location of the
# .wgetrc file. BUT:acc. to docs, they should be proxy_user and
proxy_passwd,
# not proxy-user and proxy-passwd.
LWP
export ftp_proxy=proxyuserid:[email protected]:21
export http_proxy=http://proxyuserid:[email protected]:1080
# Then in the LWP::UserAgent or LWP::RobotUA script, do this:
$ua->env_proxy;
# or, it can be done without the environment variables, by hard coding the
# proxy information in the script:
$ua->proxy(['http', 'ftp'] => 'http://proxyuid:[email protected]:1080'
);
Lynx
invoke lynx command with:
lynx -pauth=proxyuserid:proxypass http://www.yahoo.com/
However, this gives an error message:
Invalid Header: 'Proxy Authenticate: NTLM'
before retrying and succeeding.
PPM (ActiveState's Perl Package Manager)
set HTTP_proxy=http://wwwproxy.foo.com:1080
set HTTP_proxy_user=youruserid
set HTTP_proxy_pass=yourpassword
######## hard coded files to change when password changes
.wgetrc
######## not working, or not yet tested
# w3m
# This sets the configuration options http_proxy and, as a side effect,
# https_proxy, and stores them. However, the command does not
# succeed, and manual input of the userid/password at a prompt is required.
# either it's not working as described, or, more likely, our firewall
is special.
w3m -pauth userid:password -o
http_proxy=http://wwwgate0.company.com:1080/ http://www.yahoo.com/
# perl modules
For https proxying, Crypt::SSLeay uses:
HTTPS_PROXY_USERNAME
HTTPS_PROXY_PASSWORD
(note long variables: username and password, not user and pass).
Net::FTP configuration uses environment variables:
FTP_FIREWALL= hostname.com # syntax unverified
FTP_FIREWALL_TYPE=2
FTP_PASSIVE=on # name of variable verified; value syntax not verified
# ftp configuration, using .netrc file:
# where [email protected] is being sent as the password for the remote host
machine ftp_proxy_machine.com login proxyuserid passwd proxypassword
macdef init
user " [email protected] 21" [email protected]
..(commands here)
quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment