summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostyantyn Ovechko <fastinetserver@gmail.com>2010-07-28 02:16:04 +0300
committerKostyantyn Ovechko <fastinetserver@gmail.com>2010-07-28 02:16:04 +0300
commit9856167583bac5fc114ce5689a7b881d6bcfdbd0 (patch)
tree8dfbb2f1aaaa2fdea122bbed48f8c070288bced0
parentAdd options FOLLOW_LOCATION and MAX_REDIRS to network#.conf files (diff)
downloadidfetch-9856167583bac5fc114ce5689a7b881d6bcfdbd0.tar.gz
idfetch-9856167583bac5fc114ce5689a7b881d6bcfdbd0.tar.bz2
idfetch-9856167583bac5fc114ce5689a7b881d6bcfdbd0.zip
Add option proxy_type to network#.conf files
SYNOPSIS: PROXY_TYPE = 0 | 1 | 2 | 3 | 4 | 5 0 - HTTP 1 - HTTP_1_0 2 - SOCKS4 3 - SOCKS4a 4 - SOCKS5 5 - SOCKS5_HOSTNAME Specify type of the proxy. Default: proxy_type=0
-rw-r--r--segget/network.cpp12
-rw-r--r--segget/network.h10
-rw-r--r--segget/network0.conf13
-rw-r--r--segget/network1.conf277
-rw-r--r--segget/network1_mirrors.conf1
-rw-r--r--segget/network2.conf277
-rw-r--r--segget/segment.cpp1
7 files changed, 35 insertions, 556 deletions
diff --git a/segget/network.cpp b/segget/network.cpp
index 7230774..fb849df 100644
--- a/segget/network.cpp
+++ b/segget/network.cpp
@@ -85,6 +85,18 @@ void Tnetwork::init(uint priority_value){
conf.set("network_proxy","proxy_user",proxy_user);
conf.set("network_proxy","proxy_password",proxy_password);
+ ulong raw_proxy_type=0;
+ conf.set("network_proxy","proxy_type",raw_proxy_type,0,5);
+ switch (raw_proxy_type){
+ case HTTP: proxy_type=CURLPROXY_HTTP; break;
+ case HTTP_1_0: proxy_type=CURLPROXY_HTTP_1_0; break;
+ case SOCKS4: proxy_type=CURLPROXY_SOCKS4; break;
+ case SOCKS4a: proxy_type=CURLPROXY_SOCKS4A; break;
+ case SOCKS5: proxy_type=CURLPROXY_SOCKS5; break;
+ case SOCKS5_HOSTNAME: proxy_type=CURLPROXY_SOCKS5_HOSTNAME; break;
+ default : proxy_type=CURLPROXY_HTTP; break;
+ }
+
// conf.set(use_own_mirror_list_only_on, "network_mirrors", "use_own_mirror_list_only_on");
switch (network_mode){
diff --git a/segget/network.h b/segget/network.h
index 78476f0..f88c9b5 100644
--- a/segget/network.h
+++ b/segget/network.h
@@ -29,6 +29,7 @@
//#include <string>
//#include <map>
#include <vector>
+#include <curl/curl.h>
#include "str.h"
#include "mirror.h"
class Tmirror;
@@ -44,6 +45,13 @@ using namespace std;
#define MODE_LOCAL 2
#define MODE_CORAL_CDN 3
+#define HTTP 0
+#define HTTP_1_0 1
+#define SOCKS4 2
+#define SOCKS4a 3
+#define SOCKS5 4
+#define SOCKS5_HOSTNAME 5
+
class Tnetwork{
static uint network_count;
private:
@@ -78,6 +86,7 @@ class Tnetwork{
bool proxy_off;
string proxy_user;
string proxy_password;
+ ulong proxy_type;
//proxy_fetcher
string proxy_fetcher_ip;
ulong proxy_fetcher_port;
@@ -113,6 +122,7 @@ class Tnetwork{
proxy_off(1),
proxy_user("none"),
proxy_password("none"),
+ proxy_type(CURLPROXY_HTTP),
//proxy_fetcher
proxy_fetcher_ip("none"),
proxy_fetcher_port(3131),
diff --git a/segget/network0.conf b/segget/network0.conf
index e56f3bb..bc5d71c 100644
--- a/segget/network0.conf
+++ b/segget/network0.conf
@@ -135,7 +135,6 @@ low_connection_speed_time=10
# max_connection_speed=0
max_connection_speed=3000
-
# SYNOPSIS: FOLLOW_LOCATION= 0 | 1
# A parameter set to 1 tells segget to follow any Location: header that the server
# sends as part of an HTTP header. This means that the segget will re-send the
@@ -223,6 +222,18 @@ proxy_user=none
# proxy_password=none
proxy_password=none
+# SYNOPSIS: PROXY_TYPE = 0 | 1 | 2 | 3 | 4 | 5
+# 0 - HTTP
+# 1 - HTTP_1_0
+# 2 - SOCKS4
+# 3 - SOCKS4a
+# 4 - SOCKS5
+# 5 - SOCKS5_HOSTNAME
+# Specify type of the proxy.
+# Default:
+# proxy_type=0
+proxy_type=0
+
# SYNOPSIS: proxy_off=0 | 1
# Setting the proxy_off=1 will explicitly disable the use of a proxy, even if
# there is an environment variable set for it.
diff --git a/segget/network1.conf b/segget/network1.conf
deleted file mode 100644
index 2d813b1..0000000
--- a/segget/network1.conf
+++ /dev/null
@@ -1,277 +0,0 @@
-[mode]
-# SYNOPSIS: NETWORK_MODE= 0 | 1 | 2 | 3
-# 0 - remote mirrors (default)
-# 1 - proxy fetcher
-# 2 - local mirrors
-# 3 - CoralCDN
-# - If set to 0, segget will use ONLY mirror list provided by portage
-# system, and will NOT use the list from network0_mirrors.conf file.
-# - If set to 1 or 2, segget will replace mirror list provided by portage
-# system with the list from network#_mirrors.conf file
-# - If set to 3, segget will convert mirrors provided by portage system
-# to use CoralCDN caches.
-# In some cases it's necessary to make segget prefer local mirrors over
-# the remote ones. For this purpose define settings for 2 networks:
-# settings for network0 (to provide access to local mirrors),
-# settings for network1 (to provide access to remote ones).
-# 1) Set the following options in segget.conf file:
-# [networks]
-# network0_priority=10
-# network1_priority=9
-# As you can see network0 (with local mirrors) has higher priority than
-# network1 (with mirrors provided by portage).
-# 2) Set NETWORK_MODE=2 in network0.conf file.
-# 3) Create network0_mirrors.conf file with the list of your local
-# mirrors.
-# For example, network0_mirrors.conf may look like this:
-# http://192.168.210.12/
-# ftp://192.168.210.205/
-# http://192.168.210.56/
-# 4) Set NETWORK_MODE=0 in network1.conf file,
-# so segget will use remote mirrors working via this network.
-# NOTE: Actually network0 and network1 can be the same LAN with only
-# one ip address set on the host. The only difference is that in case of
-# network1 segget will have to use a gateway to access remote mirrors.
-# Default:
-# network_mode=0
-network_mode=1
-
-[network_bind]
-# BIND INTERFACE / IP
-# Pass a string as parameter. This sets the interface name to use as outgoing
-# network interface. The name can be an interface name, an IP address, or a host
-# name. No binding is set by default.
-# Default:
-# bind_interface=none
-bind_interface=none
-
-# BIND LOCALPORT
-# Pass a long. This sets the local port number of the socket used for connection.
-# This can be used in combination with BIND_INTERFACE and you are recommended to
-# use BIND_LOCALPORTRANGE as well when this is set.
-# Valid port numbers are 1 - 65535.
-
-# BIND_LOCALPORTRANGE
-# Pass a long. This is the number of attempts segget should make to find a
-# working local port number. It starts with the given BIND_LOCALPORT and adds
-# one to the number for each retry. Setting this to 1 or below will make segget
-# do only one try for the exact port number. Port numbers by nature are scarce
-# resources that will be busy at times so setting this value to something too
-# low might cause unnecessary connection setup failures.
-
-[network_connections]
-# NETWORK_MAX_CONNECTIONS
-# Define maximum number of connections
-# Minimum value: 1
-# Maximum value: 20
-# Default:
-# max_connections=10
-max_connections=3
-
-# CONNECTION_TIMEOUT
-# Set the number of seconds to wait while trying to connect. Use 0 to wait
-# indefinitely. Pass a long. It should contain the maximum time in seconds that
-# you allow the connection to the server to take. This only limits the connection
-# phase, once it has connected, this option is of no more use. Set to zero to
-# disable connection timeout (it will then only timeout on the system's internal
-# timeouts). See also the TIMEOUT option.
-# Minimum value: 1
-# Maximum value: 1000
-# Default:
-# connection_timeout=15
-connection_timeout=15
-
-# FTP_RESPONSE_TIMEOUT
-# Set a timeout period (in seconds) on the amount of time that the server is
-# allowed to take in order to generate a response message for a command before the
-# session is considered hung. While awaiting for a response, this value overrides
-# TIMEOUT. It is recommended that if used in conjunction with TIMEOUT, you set
-# FTP_RESPONSE_TIMEOUT to a value smaller than TIMEOUT.
-# Minimum value: 1
-# Maximum value: -1 (for no limit)
-# Default:
-# ftp_response_timeout=180
-ftp_response_timeout=180
-
-# TIMEOUT
-# maximum amount of time to download segment in seconds
-# Set the maximum number of seconds for a connection to execute.
-# Pass a long as parameter containing the maximum time in seconds that you allow
-# the transfer operation to take. Normally, name lookups can take a considerable
-# time and limiting operations to less than a few minutes risk aborting perfectly
-# normal operations.
-# Minimum value: 100
-# Maximum value: -1 (for no limit)
-# Default:
-# timeout=500
-timeout=500
-
-# LOW_CONNECTION_SPEED_LIMIT
-# Define the low speed limit for connection. Pass a long as parameter. It
-# contains the transfer speed in bytes per second that the transfer should be
-# below during LOW_CONNECTION_SPEED_TIME seconds to consider it too slow and abort.
-# Minimum value: 1
-# Maximum value: -1 (-1 for no limit)
-# Default:
-# low_connection_speed_limit=1000
-low_connection_speed_limit=1000
-
-# LOW_CONNECTION_SPEED_TIME
-# Pass a long as parameter. It contains the time in seconds that the transfer
-# should be below the LOW_CONNECTION_SPEED_LIMIT to consider it too slow and abort.
-# Minimum value: 1
-# Maximum value: 600
-# Default:
-# low_connection_speed_time=10
-low_connection_speed_time=10
-
-# MAX_CONNECTION_SPEED
-# If a download exceeds this speed (counted in bytes per second) on cumulative
-# average during the transfer, the transfer will pause to keep the average rate
-# less than or equal to the parameter value. Defaults to unlimited speed.
-# Minimum value: 1
-# Maximum value: -1 (-1 for no limit)
-# Default:
-# max_connection_speed=0
-max_connection_speed=3000
-
-# SYNOPSIS: FOLLOW_LOCATION= 0 | 1
-# A parameter set to 1 tells segget to follow any Location: header that the server
-# sends as part of an HTTP header. This means that the segget will re-send the
-# same request on the new location and follow new Location: headers all the way
-# until no more such headers are returned. MAX_REDIRS can be used to limit the
-# number of redirects segget will follow.
-# Default:
-# follow_location=1
-follow_location=1
-
-# MAX_REDIRS
-# The set number will be the redirection limit. If that many redirections have
-# been followed, the next redirect will cause an error. This option only makes
-# sense if the FOLLOW_LOCATION is used at the same time.
-# Setting the limit to 0 will make segget refuse any redirect.
-# Minimum value: 0
-# Maximum value: 100
-# Default:
-# max_redirs=5
-max_redirs=5
-
-[network_protocols]
-# SYNOPSIS: http_on=0 | 1
-# Default:
-# http_on=1
-# NOT IMPLEMENTED YET: http_on=1
-
-# SYNOPSIS: ftp_on=0 | 1
-# Default:
-# ftp_on=1
-# NOT IMPLEMENTED YET: ftp_on=1
-
-[network_user_data]
-# USER_AGENT
-# Set the User-Agent: header in the http request sent to the remote server.
-# This can be used to fool servers or scripts.
-# Default:
-# user_agent=segget
-user_agent=segget
-
-# Specify the user and password for authentication on a ftp servers.
-# NOT IMPLEMENTED YET: ftp-user=anonymous
-# NOT IMPLEMENTED YET: ftp-password=me@mail.ru
-
-[network_proxy]
-# PROXY_IP_OR_NAME
-# Specify a proxy to use (address and port).
-# Set HTTP proxy to use. The parameter should be a string holding the proxy host
-# name or dotted IP address. To specify port number in this string,
-# append :[port] to the end of the host name. The proxy string may be prefixed
-# with [protocol]:// since any such prefix will be ignored. The proxy's port
-# number may optionally be specified with the separate option. If not specified,
-# by default port 1080 will be used for proxies.
-# When you tell segget to use an HTTP proxy, segget will transparently convert
-# operations to HTTP even if you specify an FTP URL etc.
-# Segget respects the environment variables http_proxy, ftp_proxy, all_proxy etc,
-# if any of those are set. The PROXY option does however override any possibly
-# set environment variables.
-# Default:
-# proxy_ip_or_name=none
-proxy_ip_or_name=none
-
-# PROXY_PORT
-# Set the proxy port to connect to unless it is specified in the PROXY option.
-# Minimum value: 1
-# Maximum value: 65535
-# Default:
-# proxy_port=3128
-proxy_port=3128
-
-# PROXY_USER
-# Set user name to use for the transfer while connecting to Proxy.
-# The PROXY_USER option should be used in same way as the PROXY_PASSWORD is used.
-# In order to specify the password to be used in conjunction with the user name
-# use the PROXY_PASSWORD option.
-# Default:
-# proxy_user=none
-proxy_user=none
-
-# PROXY_PASSWORD
-# Set password to use for the transfer while connecting to Proxy.
-# The PROXY_PASSWORD option should be used in conjunction with the PROXY_USER
-# option.
-# Default:
-# proxy_password=none
-proxy_password=none
-
-# SYNOPSIS: proxy_off=0 | 1
-# Setting the proxy_off=1 will explicitly disable the use of a proxy, even if
-# there is an environment variable set for it.
-# Default:
-# proxy_off=1
-proxy_off=1
-
-[network_proxy_fetcher]
-# PROXY_FETCHER_IP
-# This option is active only when NETWORK_MODE=1, in other cases it's ignored.
-# Specify IP addres of the proxy-fetcher
-# Default:
-# proxy_fetcher_ip=none
-proxy_fetcher_ip=127.0.0.1
-
-# PROXY_FETCHER_PORT
-# This option is active only when NETWORK_MODE=1, in other cases it's ignored.
-# Specify proxy-fetcher address
-# Default:
-# proxy_fetcher_port=3131
-proxy_fetcher_port=3131
-
-# Specify the user and password for authentication on a proxy-fetcher-server.
-# NOT IMPLEMENTED YET: proxy-fetcher-user=user
-# NOT IMPLEMENTED YET: proxy-fetcher-password=password
-# Set to forbid direct connections to Internet servers if it's possible to use
-# proxy-fetcher.
-# NOT IMPLEMENTED YET: use-proxy-fetcher-demon-if-possible=1
-# Set to forbid direct connections to Internet servers.
-# NOT IMPLEMENTED YET: use-proxy-fetcher-demon-only=0
-# Set to forbid using proxy-fetcher.
-# NOT IMPLEMENTED YET: no-proxy-fetcher
-
-[network_mirrors]
-# SYNOPSIS: ONLY_LOCAL_WHEN_POSSIBLE=0 | 1
-# If NETWORK_MODE=0 or NETWORK_MODE=1 this option will be ignored.
-# - If set to 1, segget will not use remote mirrors with equal or lower
-# priority until all mirrors in network#_mirrors.conf file have failed.
-# - If set to 0, segget will use remote mirrors with equal priority or
-# mirrors with lower priority when this network has NO free connections
-# (see option NETWORK_MAX_CONNECTIONS in [network_connections] section
-# of this file).
-# NOTE: Following example for NETWORK_MODE option,
-# if in network0.conf has option ONLY_LOCAL_WHEN_POSSIBLE=1, segget
-# will NOT start to use network1 for a particular distfile until all
-# mirrors specified in network0_mirrors.conf file will have failed
-# to provide this distfile.
-# On the other hand if ONLY_LOCAL_WHEN_POSSIBLE=0 segget will start
-# to use network1 as soon as NETWORK_MAX_CONNECTIONS limit, set
-# in network0.conf file has been reached.
-# Default:
-# only_local_when_possible=1
-only_local_when_possible=1 \ No newline at end of file
diff --git a/segget/network1_mirrors.conf b/segget/network1_mirrors.conf
deleted file mode 100644
index 9406219..0000000
--- a/segget/network1_mirrors.conf
+++ /dev/null
@@ -1 +0,0 @@
-http://127.0.0.1/ \ No newline at end of file
diff --git a/segget/network2.conf b/segget/network2.conf
deleted file mode 100644
index ae243ef..0000000
--- a/segget/network2.conf
+++ /dev/null
@@ -1,277 +0,0 @@
-[mode]
-# SYNOPSIS: NETWORK_MODE= 0 | 1 | 2 | 3
-# 0 - remote mirrors (default)
-# 1 - proxy fetcher
-# 2 - local mirrors
-# 3 - CoralCDN
-# - If set to 0, segget will use ONLY mirror list provided by portage
-# system, and will NOT use the list from network0_mirrors.conf file.
-# - If set to 1 or 2, segget will replace mirror list provided by portage
-# system with the list from network#_mirrors.conf file
-# - If set to 3, segget will convert mirrors provided by portage system
-# to use CoralCDN caches.
-# In some cases it's necessary to make segget prefer local mirrors over
-# the remote ones. For this purpose define settings for 2 networks:
-# settings for network0 (to provide access to local mirrors),
-# settings for network1 (to provide access to remote ones).
-# 1) Set the following options in segget.conf file:
-# [networks]
-# network0_priority=10
-# network1_priority=9
-# As you can see network0 (with local mirrors) has higher priority than
-# network1 (with mirrors provided by portage).
-# 2) Set NETWORK_MODE=2 in network0.conf file.
-# 3) Create network0_mirrors.conf file with the list of your local
-# mirrors.
-# For example, network0_mirrors.conf may look like this:
-# http://192.168.210.12/
-# ftp://192.168.210.205/
-# http://192.168.210.56/
-# 4) Set NETWORK_MODE=0 in network1.conf file,
-# so segget will use remote mirrors working via this network.
-# NOTE: Actually network0 and network1 can be the same LAN with only
-# one ip address set on the host. The only difference is that in case of
-# network1 segget will have to use a gateway to access remote mirrors.
-# Default:
-# network_mode=0
-network_mode=0
-
-[network_bind]
-# BIND INTERFACE / IP
-# Pass a string as parameter. This sets the interface name to use as outgoing
-# network interface. The name can be an interface name, an IP address, or a host
-# name. No binding is set by default.
-# Default:
-# bind_interface=none
-bind_interface=none
-
-# BIND LOCALPORT
-# Pass a long. This sets the local port number of the socket used for connection.
-# This can be used in combination with BIND_INTERFACE and you are recommended to
-# use BIND_LOCALPORTRANGE as well when this is set.
-# Valid port numbers are 1 - 65535.
-
-# BIND_LOCALPORTRANGE
-# Pass a long. This is the number of attempts segget should make to find a
-# working local port number. It starts with the given BIND_LOCALPORT and adds
-# one to the number for each retry. Setting this to 1 or below will make segget
-# do only one try for the exact port number. Port numbers by nature are scarce
-# resources that will be busy at times so setting this value to something too
-# low might cause unnecessary connection setup failures.
-
-[network_connections]
-# NETWORK_MAX_CONNECTIONS
-# Define maximum number of connections
-# Minimum value: 1
-# Maximum value: 20
-# Default:
-# max_connections=10
-max_connections=3
-
-# CONNECTION_TIMEOUT
-# Set the number of seconds to wait while trying to connect. Use 0 to wait
-# indefinitely. Pass a long. It should contain the maximum time in seconds that
-# you allow the connection to the server to take. This only limits the connection
-# phase, once it has connected, this option is of no more use. Set to zero to
-# disable connection timeout (it will then only timeout on the system's internal
-# timeouts). See also the TIMEOUT option.
-# Minimum value: 1
-# Maximum value: 1000
-# Default:
-# connection_timeout=15
-connection_timeout=15
-
-# FTP_RESPONSE_TIMEOUT
-# Set a timeout period (in seconds) on the amount of time that the server is
-# allowed to take in order to generate a response message for a command before the
-# session is considered hung. While awaiting for a response, this value overrides
-# TIMEOUT. It is recommended that if used in conjunction with TIMEOUT, you set
-# FTP_RESPONSE_TIMEOUT to a value smaller than TIMEOUT.
-# Minimum value: 1
-# Maximum value: -1 (for no limit)
-# Default:
-# ftp_response_timeout=180
-ftp_response_timeout=180
-
-# TIMEOUT
-# maximum amount of time to download segment in seconds
-# Set the maximum number of seconds for a connection to execute.
-# Pass a long as parameter containing the maximum time in seconds that you allow
-# the transfer operation to take. Normally, name lookups can take a considerable
-# time and limiting operations to less than a few minutes risk aborting perfectly
-# normal operations.
-# Minimum value: 100
-# Maximum value: -1 (for no limit)
-# Default:
-# timeout=500
-timeout=500
-
-# LOW_CONNECTION_SPEED_LIMIT
-# Define the low speed limit for connection. Pass a long as parameter. It
-# contains the transfer speed in bytes per second that the transfer should be
-# below during LOW_CONNECTION_SPEED_TIME seconds to consider it too slow and abort.
-# Minimum value: 1
-# Maximum value: -1 (-1 for no limit)
-# Default:
-# low_connection_speed_limit=1000
-low_connection_speed_limit=1000
-
-# LOW_CONNECTION_SPEED_TIME
-# Pass a long as parameter. It contains the time in seconds that the transfer
-# should be below the LOW_CONNECTION_SPEED_LIMIT to consider it too slow and abort.
-# Minimum value: 1
-# Maximum value: 600
-# Default:
-# low_connection_speed_time=10
-low_connection_speed_time=10
-
-# MAX_CONNECTION_SPEED
-# If a download exceeds this speed (counted in bytes per second) on cumulative
-# average during the transfer, the transfer will pause to keep the average rate
-# less than or equal to the parameter value. Defaults to unlimited speed.
-# Minimum value: 1
-# Maximum value: -1 (-1 for no limit)
-# Default:
-# max_connection_speed=0
-max_connection_speed=3000
-
-# SYNOPSIS: FOLLOW_LOCATION= 0 | 1
-# A parameter set to 1 tells segget to follow any Location: header that the server
-# sends as part of an HTTP header. This means that the segget will re-send the
-# same request on the new location and follow new Location: headers all the way
-# until no more such headers are returned. MAX_REDIRS can be used to limit the
-# number of redirects segget will follow.
-# Default:
-# follow_location=1
-follow_location=1
-
-# MAX_REDIRS
-# The set number will be the redirection limit. If that many redirections have
-# been followed, the next redirect will cause an error. This option only makes
-# sense if the FOLLOW_LOCATION is used at the same time.
-# Setting the limit to 0 will make segget refuse any redirect.
-# Minimum value: 0
-# Maximum value: 100
-# Default:
-# max_redirs=5
-max_redirs=5
-
-[network_protocols]
-# SYNOPSIS: http_on=0 | 1
-# Default:
-# http_on=1
-# NOT IMPLEMENTED YET: http_on=1
-
-# SYNOPSIS: ftp_on=0 | 1
-# Default:
-# ftp_on=1
-# NOT IMPLEMENTED YET: ftp_on=1
-
-[network_user_data]
-# USER_AGENT
-# Set the User-Agent: header in the http request sent to the remote server.
-# This can be used to fool servers or scripts.
-# Default:
-# user_agent=segget
-user_agent=segget
-
-# Specify the user and password for authentication on a ftp servers.
-# NOT IMPLEMENTED YET: ftp-user=anonymous
-# NOT IMPLEMENTED YET: ftp-password=me@mail.ru
-
-[network_proxy]
-# PROXY_IP_OR_NAME
-# Specify a proxy to use (address and port).
-# Set HTTP proxy to use. The parameter should be a string holding the proxy host
-# name or dotted IP address. To specify port number in this string,
-# append :[port] to the end of the host name. The proxy string may be prefixed
-# with [protocol]:// since any such prefix will be ignored. The proxy's port
-# number may optionally be specified with the separate option. If not specified,
-# by default port 1080 will be used for proxies.
-# When you tell segget to use an HTTP proxy, segget will transparently convert
-# operations to HTTP even if you specify an FTP URL etc.
-# Segget respects the environment variables http_proxy, ftp_proxy, all_proxy etc,
-# if any of those are set. The PROXY option does however override any possibly
-# set environment variables.
-# Default:
-# proxy_ip_or_name=none
-proxy_ip_or_name=none
-
-# PROXY_PORT
-# Set the proxy port to connect to unless it is specified in the PROXY option.
-# Minimum value: 1
-# Maximum value: 65535
-# Default:
-# proxy_port=3128
-proxy_port=3128
-
-# PROXY_USER
-# Set user name to use for the transfer while connecting to Proxy.
-# The PROXY_USER option should be used in same way as the PROXY_PASSWORD is used.
-# In order to specify the password to be used in conjunction with the user name
-# use the PROXY_PASSWORD option.
-# Default:
-# proxy_user=none
-proxy_user=none
-
-# PROXY_PASSWORD
-# Set password to use for the transfer while connecting to Proxy.
-# The PROXY_PASSWORD option should be used in conjunction with the PROXY_USER
-# option.
-# Default:
-# proxy_password=none
-proxy_password=none
-
-# SYNOPSIS: proxy_off=0 | 1
-# Setting the proxy_off=1 will explicitly disable the use of a proxy, even if
-# there is an environment variable set for it.
-# Default:
-# proxy_off=1
-proxy_off=1
-
-[network_proxy_fetcher]
-# PROXY_FETCHER_IP
-# This option is active only when NETWORK_MODE=1, in other cases it's ignored.
-# Specify IP addres of the proxy-fetcher
-# Default:
-# proxy_fetcher_ip=none
-proxy_fetcher_ip=none
-
-# PROXY_FETCHER_PORT
-# This option is active only when NETWORK_MODE=1, in other cases it's ignored.
-# Specify proxy-fetcher address
-# Default:
-# proxy_fetcher_port=3131
-proxy_fetcher_port=3131
-
-# Specify the user and password for authentication on a proxy-fetcher-server.
-# NOT IMPLEMENTED YET: proxy-fetcher-user=user
-# NOT IMPLEMENTED YET: proxy-fetcher-password=password
-# Set to forbid direct connections to Internet servers if it's possible to use
-# proxy-fetcher.
-# NOT IMPLEMENTED YET: use-proxy-fetcher-demon-if-possible=1
-# Set to forbid direct connections to Internet servers.
-# NOT IMPLEMENTED YET: use-proxy-fetcher-demon-only=0
-# Set to forbid using proxy-fetcher.
-# NOT IMPLEMENTED YET: no-proxy-fetcher
-
-[network_mirrors]
-# SYNOPSIS: ONLY_LOCAL_WHEN_POSSIBLE=0 | 1
-# If NETWORK_MODE=0 or NETWORK_MODE=1 this option will be ignored.
-# - If set to 1, segget will not use remote mirrors with equal or lower
-# priority until all mirrors in network#_mirrors.conf file have failed.
-# - If set to 0, segget will use remote mirrors with equal priority or
-# mirrors with lower priority when this network has NO free connections
-# (see option NETWORK_MAX_CONNECTIONS in [network_connections] section
-# of this file).
-# NOTE: Following example for NETWORK_MODE option,
-# if in network0.conf has option ONLY_LOCAL_WHEN_POSSIBLE=1, segget
-# will NOT start to use network1 for a particular distfile until all
-# mirrors specified in network0_mirrors.conf file will have failed
-# to provide this distfile.
-# On the other hand if ONLY_LOCAL_WHEN_POSSIBLE=0 segget will start
-# to use network1 as soon as NETWORK_MAX_CONNECTIONS limit, set
-# in network0.conf file has been reached.
-# Default:
-# only_local_when_possible=1
-only_local_when_possible=1 \ No newline at end of file
diff --git a/segget/segment.cpp b/segget/segment.cpp
index 5201c54..100d8ca 100644
--- a/segget/segment.cpp
+++ b/segget/segment.cpp
@@ -152,6 +152,7 @@ int Tsegment::add_easy_handle_to_multi(CURLM *cm, uint network_num){
if (network_array[network_num].proxy_password!="none")
curl_easy_setopt(easyhandle, CURLOPT_PROXYPASSWORD, network_array[network_num].proxy_password.c_str());
}
+ curl_easy_setopt(easyhandle, CURLOPT_PROXYTYPE, network_array[network_num].proxy_type);
}
if ((network_array[network_num].bind_interface!="none")