From ca2b33c3dafd62ebc344e7711add819ba42514fa Mon Sep 17 00:00:00 2001
From: Tatsuhiro Tsujikawa
Date: Thu, 11 Mar 2010 15:09:34 +0000
Subject: [PATCH] 2010-03-12 Tatsuhiro Tsujikawa
Resurrected --http-proxy-user and --http-proxy-passwd option.
Added --https-proxy-user, --https-proxy-passwd, --ftp-proxy-user,
--ftp-proxy-passwd, --all-proxy-user, --all-proxy-passwd option.
* doc/aria2c.1.txt
* src/OptionHandlerFactory.cc
* src/OptionHandlerImpl.h
* src/prefs.cc
* src/prefs.h
* src/usage_text.h
* test/OptionHandlerTest.cc
---
ChangeLog | 13 ++++
doc/aria2c.1 | 93 +++++++++++++++++++++++++++-
doc/aria2c.1.html | 92 ++++++++++++++++++++++++++-
doc/aria2c.1.txt | 55 ++++++++++++++++-
src/OptionHandlerFactory.cc | 70 +++++++++++++++++++++
src/OptionHandlerImpl.h | 120 ++++++++++++++++++++++++++++++++++--
src/prefs.cc | 8 +++
src/prefs.h | 8 +++
src/usage_text.h | 16 +++++
test/OptionHandlerTest.cc | 94 ++++++++++++++++++++++++++++
10 files changed, 560 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 31b1d277..17a40f3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-03-12 Tatsuhiro Tsujikawa
+
+ Resurrected --http-proxy-user and --http-proxy-passwd option.
+ Added --https-proxy-user, --https-proxy-passwd, --ftp-proxy-user,
+ --ftp-proxy-passwd, --all-proxy-user, --all-proxy-passwd option.
+ * doc/aria2c.1.txt
+ * src/OptionHandlerFactory.cc
+ * src/OptionHandlerImpl.h
+ * src/prefs.cc
+ * src/prefs.h
+ * src/usage_text.h
+ * test/OptionHandlerTest.cc
+
2010-03-10 Tatsuhiro Tsujikawa
Updated Russian and Simplified Chinese translation. Thanks to all
diff --git a/doc/aria2c.1 b/doc/aria2c.1
index 44f1ea6d..91ad4374 100644
--- a/doc/aria2c.1
+++ b/doc/aria2c.1
@@ -2,12 +2,12 @@
.\" Title: aria2c
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2
-.\" Date: 03/09/2010
+.\" Date: 03/12/2010
.\" Manual: Aria2 Manual
-.\" Source: Aria2 1.9.0a
+.\" Source: Aria2 1.9.0
.\" Language: English
.\"
-.TH "ARIA2C" "1" "03/09/2010" "Aria2 1\&.9\&.0a" "Aria2 Manual"
+.TH "ARIA2C" "1" "03/12/2010" "Aria2 1\&.9\&.0" "Aria2 Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -114,6 +114,36 @@ and
\fB\-\-ftp\-proxy\fR
options\&. This affects all URLs\&. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT]
.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+.sp
+If user and password are embedded in proxy URI and they are also specified by \fB\-\-{http,https,ftp,all}\-proxy\-{user,passwd}\fR options, those appeared later have precedence\&. For example, you have http\-proxy\-user="myname", http\-proxy\-passwd="mypass" in aria2\&.conf and you specify \-\-http\-proxy="http://proxy" in command\-line, then you get HTTP proxy "http://proxy" with user "myname" and password "mypass"\&. Another example: if you specified in command\-line \-\-http\-proxy="http://user:pass@proxy" \-\-http\-proxy\-user="myname" \-\-http\-proxy\-passwd="mypass", then you will get HTTP proxy "http://proxy" with user "myname" and password "mypass"\&. One more example: if you specified in command\-line \-\-http\-proxy\-user="myname" \-\-http\-proxy\-passwd="mypass" \-\-http\-proxy="http://user:pass@proxy", then you get HTTP proxy "http://proxy" with user "user" and password "pass"\&.
+.sp .5v
+.RE
+.PP
+\fB\-\-all\-proxy\-passwd\fR=PASSWD
+.RS 4
+Set password for
+\fB\-\-all\-proxy\fR
+option\&.
+.RE
+.PP
+\fB\-\-all\-proxy\-user\fR=USER
+.RS 4
+Set user for
+\fB\-\-all\-proxy\fR
+option\&.
+.RE
.PP
\fB\-\-connect\-timeout\fR=SEC
.RS 4
@@ -339,6 +369,25 @@ Use this proxy server for HTTP\&. To erase previously defined proxy, use ""\&. S
option\&. This affects all URLs\&. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT]
.RE
.PP
+\fB\-\-http\-proxy\-passwd\fR=PASSWD
+.RS 4
+Set password for
+\fB\-\-http\-proxy\fR
+option\&.
+.RE
+.sp
+\fB\-\-http\-proxy\-user\fR=USER:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+Set user for *\-\-http\-proxy* option\&.
+.fi
+.if n \{\
+.RE
+.\}
+.PP
\fB\-\-https\-proxy\fR=PROXY
.RS 4
Use this proxy server for HTTPS\&. To erase previously defined proxy, use ""\&. See also
@@ -346,6 +395,20 @@ Use this proxy server for HTTPS\&. To erase previously defined proxy, use ""\&.
option\&. This affects all URLs\&. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT]
.RE
.PP
+\fB\-\-https\-proxy\-passwd\fR=PASSWD
+.RS 4
+Set password for
+\fB\-\-https\-proxy\fR
+option\&.
+.RE
+.PP
+\fB\-\-https\-proxy\-user\fR=USER
+.RS 4
+Set user for
+\fB\-\-https\-proxy\fR
+option\&.
+.RE
+.PP
\fB\-\-private\-key\fR=FILE
.RS 4
Use the private key in FILE\&. The private key must be decrypted and in PEM format\&. The behavior when encrypted one is given is undefined\&. See also
@@ -444,6 +507,20 @@ Use this proxy server for FTP\&. To erase previously defined proxy, use ""\&. Se
option\&. This affects all URLs\&. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT]
.RE
.PP
+\fB\-\-ftp\-proxy\-passwd\fR=PASSWD
+.RS 4
+Set password for
+\fB\-\-ftp\-proxy\fR
+option\&.
+.RE
+.PP
+\fB\-\-ftp\-proxy\-user\fR=USER
+.RS 4
+Set user for
+\fB\-\-ftp\-proxy\fR
+option\&.
+.RE
+.PP
\fB\-\-ftp\-type\fR=TYPE
.RS 4
Set FTP transfer type\&. TYPE is either
@@ -2889,6 +2966,16 @@ aria2c \-\-http\-proxy="http://username:password@proxy:8080" "http://host/file"
.if n \{\
.RE
.\}
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+aria2c \-\-http\-proxy="http://proxy:8080" \-\-http\-proxy\-user="username" \-\-http\-proxy\-passwd="password" "http://host/file"
+.fi
+.if n \{\
+.RE
+.\}
.RE
.SS "Metalink Download"
.sp
diff --git a/doc/aria2c.1.html b/doc/aria2c.1.html
index 9bbe0653..31a65753 100644
--- a/doc/aria2c.1.html
+++ b/doc/aria2c.1.html
@@ -685,6 +685,45 @@ downloading a file like BitTorrent.
The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT]
+
+
+
+
+ Note
+ |
+If user and password are embedded in proxy URI and they are also
+specified by --{http,https,ftp,all}-proxy-{user,passwd} options,
+those appeared later have precedence. For example, you have
+http-proxy-user="myname", http-proxy-passwd="mypass" in aria2.conf and
+you specify --http-proxy="http://proxy" in command-line, then you get
+HTTP proxy "http://proxy" with user "myname" and password
+"mypass". Another example: if you specified in command-line
+--http-proxy="http://user:pass@proxy" --http-proxy-user="myname"
+--http-proxy-passwd="mypass", then you will get HTTP proxy
+"http://proxy" with user "myname" and password "mypass". One more
+example: if you specified in command-line --http-proxy-user="myname"
+--http-proxy-passwd="mypass" --http-proxy="http://user:pass@proxy",
+then you get HTTP proxy "http://proxy" with user "user" and password
+"pass". |
+
+
+
+-
+--all-proxy-passwd=PASSWD
+
+-
+
+ Set password for --all-proxy option.
+
+
+-
+--all-proxy-user=USER
+
+-
+
+ Set user for --all-proxy option.
+
+
-
--connect-timeout=SEC
@@ -970,6 +1009,21 @@ aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip"
-
+--http-proxy-passwd=PASSWD
+
+-
+
+ Set password for --http-proxy option.
+
+
+
+
+
+
+
Set user for *--http-proxy* option.
+
+
+-
--https-proxy=PROXY
-
@@ -980,6 +1034,22 @@ aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip"
-
+--https-proxy-passwd=PASSWD
+
+-
+
+ Set password for --https-proxy option.
+
+
+-
+--https-proxy-user=USER
+
+-
+
+ Set user for --https-proxy option.
+
+
+-
--private-key=FILE
-
@@ -1120,6 +1190,22 @@ aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip"
-
+--ftp-proxy-passwd=PASSWD
+
+-
+
+ Set password for --ftp-proxy option.
+
+
+-
+--ftp-proxy-user=USER
+
+-
+
+ Set user for --ftp-proxy option.
+
+
+-
--ftp-type=TYPE
-
@@ -3504,6 +3590,10 @@ You can specify proxy in the environment variables. See ENVIRONMENT
aria2c --http-proxy="http://username:password@proxy:8080" "http://host/file"
+
+
+
aria2c --http-proxy="http://proxy:8080" --http-proxy-user="username" --http-proxy-passwd="password" "http://host/file"
+
@@ -3824,7 +3914,7 @@ files in the program, then also delete it here.