diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/3proxy.cfg.md b/3proxy.cfg.md index 1e7d791..8b45a6a 100644 --- a/3proxy.cfg.md +++ b/3proxy.cfg.md @@ -1,4 +1,4 @@ - +
@@ -24,7 +24,7 @@ -3proxy.cfg +
3proxy.cfg 3proxy configuration file
Common +
Common
structure:
Configuration file is a text file 3proxy reads configuration
from. Each line of the file is a command executed
-immediately, as it was given from console. Sequence of
-commands is important. Configuration file as actually a
-script for 3proxy executable. Each line of the file is
-treated as a blank (space or tab) separated command line.
-Additional space characters are ignored. Think about 3proxy
-as "application level router" with console
-interface.
Comments:
-Any string beginning with space character or ´#´
-character is comment. It´s ignored. <LF>s are
-ignored. <CR> is end of command.
Comments:
+Any line beginning with a space character or ´#´
+character is a comment. It´s ignored. <LF>s are
+ignored. <CR> is the end of a command.
Quotation:
-Quotation character is " (double quote). Quotation must
-be used to quote spaces or another special characters. To
-use quotation character inside quotation character must be
-dubbed (BASIC convention). For example to use HELLO
-"WORLD" as an argument you should use it as
-"HELLO ""WORLD""". Good
-practice is to quote any argument you use.
Quotation:
+The quotation character is " (double quote). Quotation
+must be used to quote spaces or other special characters. To
+use a quotation character inside a quoted string, the
+character must be doubled (BASIC convention). For example,
+to use HELLO "WORLD" as an argument, you should
+write it as "HELLO ""WORLD""".
+Good practice is to quote any argument you use.
File inclusion: +
File inclusion:
You can include file by using $FILENAME macro (replace
FILENAME with a path to file, for example
@@ -68,15 +68,15 @@ is required in last example because path contains space
character. For included file <CR> (end of line
characters) is treated as space character (arguments
delimiter instead of end of command delimiter). Thus,
-include files are only useful to store long signle-line
+include files are only useful to store long single-line
commands (like userlist, network lists, etc). To use dollar
sign somewhere in argument it must be quoted. Recursion is
not allowed.
Next commands +
Next commands start gateway services:
-proxy +
proxy
[options]
socks [options]
pop3p [options]
@@ -103,16 +103,15 @@ dnspr caching DNS proxy (default port 53)
tcppm TCP portmapper
udppm UDP portmapper
Options:
-
+
Options:
-pNUMBER change default server port to NUMBER
-n disable NTLM authentication (required if passwords
are stored in Unix crypt format).
-n1 enable NTLMv1 authentication.
-g(GRACE_TRAFF,GRACE_NUM,GRACE_DELAY) delay GRACE_DELAY
-milliseconds before polling if average polling size below
-GRACE_TRAFF bytes and GRACE_NUM read operations in single
-directions are detected within 1 second. Useful to minimize
+milliseconds before polling if average polling size is below
+GRACE_TRAFF bytes and GRACE_NUM read operations in a single
+direction are detected within 1 second. Useful to minimize
polling -s
(for admin) secure, allow only secure operations, currently
only traffic counters view without ability to reset.
@@ -127,7 +126,7 @@ authentication methods
client reported)
-a1 (for proxy) anonymous proxy (random client
information reported)
--a2 (for proxy) generate Via: and X-Forwared-For:
+-a2 (for proxy) generate Via: and X-Forwarded-For:
instead of Forwarded:
-6 Only resolve IPv6 addresses. IPv4 addresses are
packed in IPv6 in IPV6_V6ONLY compatible way.
@@ -158,20 +157,20 @@ SO_REUSEPORT, SO_PORT_SCALABILITY, SO_REUSE_UNICASTPORT,
SO_KEEPALIVE, SO_DONTROUTE may be supported depending on OS.
-DiINTERFACE, -DeINTERFACE bind internal interface /
-external inteface to given INTERFACE (e.g. eth0) if
-SO_BINDTODEVICE supported by system. You may need to run as
-root or to have CAP_NET_RAW capability in order to bind to
-interface, depending on system, so this option may require
-root privileges and can be incompatible with some
-configuraton commands like chroot and setuid (and daemon if
+external interface to given INTERFACE (e.g. eth0) if
+SO_BINDTODEVICE is supported by the system. You may need to
+run as root or have CAP_NET_RAW capability in order to bind
+to an interface, depending on the system, so this option may
+require root privileges and can be incompatible with some
+configuration commands like chroot and setuid (and daemon if
setcap is used).
--e External address. IP address of interface proxy
-should initiate connections from. External IP must be
-specified if you need incoming connections. By default
-system will deside which address to use in accordance with
-routing table.
--i Internal address. IP address proxy accepts
-connections to. By default connection to any interface is
+-e External address. IP address of the interface the
+proxy should initiate connections from. External IP must be
+specified if you need incoming connections. By default the
+system will decide which address to use in accordance with
+the routing table.
+-i Internal address. IP address the proxy accepts
+connections to. By default, connections to any interface are
accepted.
-N (for socks) External NAT address 3proxy reports to
client for BIND and UDPASSOC By default external address is
@@ -205,17 +204,16 @@ FTP client does it for you. That is, if you use 3proxy with
authentication use proxyuser:proxypassword:FTPuser as FTP
username, otherwise do not change original FTP user name
include +
include
<path>
Include config file
config +
config
<path>
Path to configuration file to use on 3proxy restart or to
save configuration.
writable +
writable
ReOpens configuration file for write access via Web
interface, and rereads it. Usually should be first command
@@ -223,10 +221,10 @@ on config file but in combination with config it can be used
anywhere to open alternate config file. Think twice before
using it.
end
+
end
End of configuration
log +
log
[[@|&]logfile] [<LOGTYPE>]
sets logfile for all gateways
@ (for Unix) use syslog, filename is used as ident name
@@ -250,12 +248,12 @@ with "logformat" filename must begin with
Grinwitch time zone for all time-based format
specificators.
rotate +
rotate
<n>
how many archived log files to keep
logformat +
logformat
<format>
Format for log record. First symbol in format must be L
(local time) or G (absolute Grinwitch time). It can be
@@ -267,25 +265,25 @@ logformat means comma and percent are replaced with space
and all time based elemnts are in local time zone.
You can use:
%y Year in 2 +
%y Year in 2
digit format
%Y Year in 4 digit format
%m Month number
-%o Month abbriviature
+%o Month abbreviation
%d Day
%H Hour
%M Minute
%S Second
-%t Timstamp (in seconds since 01-Jan-1970)
+%t Timestamp (in seconds since 01-Jan-1970)
%. milliseconds
-%z timeZone (from Grinvitch)
+%z time zone (from Greenwich)
%D request duration (in milliseconds)
-%b average send rate per request (in Bytes per second) this
-speed is typically below connection speed shown by download
-manager.
-%B average receive rate per request (in Bytes per second)
-this speed is typically below connection speed shown by
+%b average send rate per request (in bytes per second); this
+speed is typically below the connection speed shown by the
download manager.
+%B average receive rate per request (in bytes per second);
+this speed is typically below the connection speed shown by
+the download manager.
%U Username
%N service Name
%p service Port
@@ -304,15 +302,15 @@ download manager.
%h Hops (redirections) count
%T service specific Text
%N1-N2T (N1 and N2 are positive numbers) log only fields
-from N1 thorugh N2 of service specific text
-in the case of ODBC logging logformat specifies SQL
-statement, for exmample:
+from N1 through N2 of service-specific text
+In the case of ODBC logging, logformat specifies an SQL
+statement, for example:
logformat "-´+_Linsert into log (l_date, l_user,
l_service, l_in, l_out, l_descr) values (´%d-%m-%Y
%H:%M:%S´, ´%U´, ´%N´, %I, %O,
´%T´)"
logdump +
logdump
<in_traffic_limit> <out_traffic_limit>
Immediately creates additional log records if given amount
of incoming/outgoing traffic is achieved for connection,
@@ -320,16 +318,14 @@ without waiting for connection to finish. It may be useful
to prevent information about long-lasting downloads on
server shutdown.
archiver +
archiver
<ext> <commandline>
Archiver to use for log files. <ext> is file extension
produced by archiver. Filename will be last argument to
archiver, optionally you can use %A as produced archive name
and %F as filename.
timeouts +
timeouts
<BYTE_SHORT> <BYTE_LONG> <STRING_SHORT>
<STRING_LONG> <CONNECTION_SHORT>
<CONNECTION_LONG> <DNS> <CHAIN>
@@ -354,7 +350,7 @@ DNS timeout for DNS request before requesting next server
CHAIN timeout for reading data from chained connection
default timeouts 1 5 30 60 180 1800 15 60 15 5
radius +
radius
<NAS_SECRET>
<radius_server_1[:port][/local_address_1]>
<radius_server_2[:port][/local_address_2]>
@@ -380,21 +376,20 @@ user), Reply-Message. Use authcache to speedup
authentication. RADIUS feature is currently
experimental.
nserver +
nserver
<ipaddr>[:port][/tcp]
Nameserver to use for name resolutions. If none specified
system routines for name resolution is used. Optional port
number may be specified. If optional /tcp is added to IP
address, name resolution is performed over TCP.
nscache +
nscache
<cachesize> nscache6 <cachesize>
Cache <cachesize> records for name resolution (nscache
-for IPv4, nscache6 for IPv6). Cachesize usually should be
-large enougth (for example 65536).
nsrecord +
nsrecord
<hostname> <hostaddr>
Adds static record to nscache. nscache must be enabled. If
0.0.0.0 is used as a hostaddr host will never resolve, it
@@ -402,13 +397,13 @@ can be used to blacklist something or together with
dialer command to set up UDL for dialing.
fakeresolve +
fakeresolve
-All names are resolved to 127.0.0.2 address. Usefull if all
-requests are redirected to parent proxy with http, socks4+,
-connect+ or socks5+.
dialer +
dialer
<progname>
Execute progname if external name can´t be resolved.
Hint: if you use nscache, dialer may not work, because names
@@ -416,16 +411,14 @@ will be resolved through cache. In this case you can use
something like http://dial.right.now/ from browser to set up
connection.
internal +
internal
<ipaddr>
sets ip address of internal interface. This IP address will
be used to bind gateways. Alternatively you can use -i
option for individual gateways. Since 0.8 version, IPv6
address may be used.
external +
external
<ipaddr>
sets ip address of external interface. This IP address will
be source address for all connections made by proxy.
@@ -433,43 +426,44 @@ Alternatively you can use -e option to specify individual
address for gateway. Since 0.8 version External or -e can be
given twice: once with IPv4 and once with IPv6 address.
maxconn +
maxconn
<number>
-sets maximum number of simulationeous connections to each
-service started after this command on network level. Default
-is 100.
+sets the maximum number of simultaneous connections to each
+service started after this command at the network level.
+Default is 100.
To limit clients, use connlim instead. maxconn will silently
ignore new connections, while connlim will report back to
the client that the connection limit has been reached.
backlog +
backlog
sets the listening socket backlog of new connections.
Default is 1 + maxconn/8. Maximum value is capped by kernel
tunable somaxconn.
service +
service
-(depricated). Indicates 3proxy to behave as Windows
-95/98/NT/2000/XP service, no effect for Unix. Not required
-for 3proxy 0.6 and above. If you upgraded from previous
-version of 3proxy use --remove and --install to reinstall
-service.
daemon +
daemon
-Should be specified to close console. Do not use
+Should be specified to close the console. Do not use
´daemon´ with ´service´. At least
-under FreeBSD ´daemon´ should preceed any proxy
-service and log commands to avoid sockets problem. Always
+under FreeBSD, ´daemon´ should precede any proxy
+service and log commands to avoid socket problems. Always
place it in the beginning of the configuration file.
auth +
auth
<authtype> [...]
Type of user authorization. Currently supported:
none - no authentication or authorization required.
-Note: is auth is none any ip based limitation, redirection,
-etc will not work. This is default authentication type
+Note: if auth is none, any IP-based limitation, redirection,
+etc. will not work. This is the default authentication type
+
iponly - authentication by access control list with username
ignored.
Appropriate for most cases
@@ -477,12 +471,12 @@ useronly - authentication by username without checking for
any password with authorization by ACLs. Useful for e.g.
SOCKSv4 proxy and icqpr (icqpr set UIN / AOL screen name as
a username)
-dnsname - authentication by DNS hostnname with authorization
-by ACLs. DNS hostname is resolved via PTR (reverse) record
-and validated (resolved name must resolve to same IP
-address). It´s recommended to use authcache by ip for
-this authentication. NB: there is no any password check,
-name may be spoofed.
+dnsname - authentication by DNS hostname with authorization
+by ACLs. The DNS hostname is resolved via a PTR (reverse)
+record and validated (the resolved name must resolve to the
+same IP address). It´s recommended to use authcache by
+IP for this authentication. NB: there is no password check;
+the name may be spoofed.
strong - username/password authentication required. It will
work with SOCKSv5, FTP, POP3 and HTTP proxy.
cache - cached authentication, may be used with
@@ -490,24 +484,24 @@ cache - cached authentication, may be used with
radius - authentication with RADIUS.
Plugins may add additional authentication types.
It´s
-possible to use few authentication types in the same
-commands. E.g.
+
It´s
+possible to use multiple authentication types in the same
+command. E.g.
auth iponly strong
-In this case ´strong´ authentication will be
-used only in case resource access can not be performed with
-´iponly´ authentication, that is username is
-required in ACL. It´s usefull to protect access to
-some resources with password allowing passwordless access to
-another resources, or to use IP-based authentication for
-dedicated laptops and request username/password for shared
-ones.
authcache +
authcache
<cachtype> <cachtime>
-Cache authentication information to given amount of time
-(cachetime) in seconds. Cahtype is one of:
+Cache authentication information for a given amount of time
+(cachetime) in seconds. Cachetype is one of:
ip - after successful authentication all connections during
caching time from same IP are assigned to the same user,
username is not requested.
@@ -525,7 +519,7 @@ ext - cache external IP
Use auth type ´cache´ for cached
authentication
allow +
allow
<userlist> <sourcelist> <targetlist>
<targetportlist> <operationlist>
<weekdayslist> <timeperiodslist>
@@ -538,13 +532,13 @@ spaces are allowed. Usernames are case sensitive (if used
with authtype nbname username must be in uppercase). Source
and target lists may contain IP addresses (W.X.Y.Z), ranges
A.B.C.D - W.X.Y.Z (since 0.8) or CIDRs (W.X.Y.Z/L). Since
-0.6, targetlist may also contain host names, instead of
-addresses. It´s possible to use wildmask in the
-begginning and in the the end of hostname, e.g. *badsite.com
-or *badcontent*. Hostname is only checked if hostname
-presents in request. Targetportlist may contain ports (X) or
-port ranges lists (X-Y). For any field * sign means ANY. If
-access list is empty it´s assumed to be
+0.6, the targetlist may also contain host names, instead of
+addresses. It´s possible to use a wildmask in the
+beginning and at the end of the hostname, e.g. *badsite.com
+or *badcontent*. The hostname is only checked if a hostname
+is present in the request. Targetportlist may contain ports
+(X) or port ranges lists (X-Y). For any field * sign means
+ANY. If access list is empty it´s assumed to be
allow *
If access list is not empty last item in access list is
assumed to be
@@ -557,8 +551,8 @@ specific addresses immediately without any conditions you
should either bind proxy to appropriate interface only or to
use ip filters.
Operation is
-one of:
+
Operation is one
+of:
CONNECT establish outgoing TCP connection
BIND bind TCP port for listening
UDPASSOC make UDP association
@@ -575,20 +569,20 @@ FTP_GET FTP get request
FTP_PUT FTP put request
FTP_LIST FTP list request
FTP_DATA FTP data connection. Note: FTP_DATA requires access
-to dynamic non-ptivileged (1024-65535) ports on remote side.
-
+to dynamic non-privileged (1024-65535) ports on the remote
+side.
FTP matches any FTP/FTP Data request
ADMIN access to administration interface
Weeksdays are -week days numbers or periods, 0 or 7 means Sunday, 1 is +
Weekdays are
+week day numbers or periods, 0 or 7 means Sunday, 1 is
Monday, 1-5 means Monday through Friday.
Timeperiodlists is a list of time periods in
HH:MM:SS-HH:MM:SS format. For example,
00:00:00-08:00:00,17:00:00-24:00:00 lists non-working
hours.
parent +
parent
<weight> <type> <ip> <port>
<username> <password>
this command must follow "allow" rule. It extends
@@ -597,9 +591,9 @@ grouped. Proxy inside the group is selected randomly. If few
groups are specified one proxy is randomly picked from each
group and chain of proxies is created (that is second proxy
connected through first one and so on). Weight is used to
-group proxies. Weigt is a number between 1 and 1000. Weights
-are summed and proxies are grouped together untill weight of
-group is 1000. That is:
+group proxies. Weight is a number between 1 and 1000.
+Weights are summed and proxies are grouped together until
+the weight of the group is 1000. That is:
allow *
parent 500 socks5 192.168.10.1 1080
parent 500 connect 192.168.10.1 3128
@@ -618,12 +612,12 @@ connections. Chains are only applied to new connections,
pipelined (keep-alive) requests in the same connection use
the same chain.
type is one of: +
type is one of:
-extip does not actully redirect request, it sets external
-address for this request to <ip>. It can be chained
-with another parent types. It’s usefaul to set
-external IP based on ACL or make it random.
+extip does not actually redirect the request; it sets the
+external address for this request to <ip>. It can be
+chained with another parent type. It’s useful to set
+the external IP based on ACL or make it random.
tcp simply redirect connection. TCP is always last in chain.
This type of proxy is a simple TCP redirection, it does not
support parent authentication.
@@ -643,10 +637,10 @@ socks4+ parent is SOCKSv4 proxy with name resolution
socks5 parent is SOCKSv5 proxy
socks5+ parent is SOCKSv5 proxy with name resolution
socks4b parent is SOCKS4b (broken SOCKSv4 implementation
-with shortened server reply. I never saw this kind ofservers
-byt they say there are). Normally you should not use this
-option. Do not mess this option with SOCKSv4a (socks4+).
-
+with shortened server reply; I never saw this kind of
+server, but they say there are some). Normally you should
+not use this option. Do not confuse this option with
+SOCKSv4a (socks4+).
socks5b parent is SOCKS5b (broken SOCKSv5 implementation
with shortened server reply. I think you will never find it
useful). Never use this option unless you know exactly you
@@ -656,7 +650,7 @@ admin redirect request to local ´admin´ service
Use "+" proxy only with "fakeresolve"
option
IP and port are +
IP and port are ip addres and port of parent proxy server. If IP is zero, ip is taken from original request, only port is changed. If port is zero, it´s taken from original request, only @@ -665,18 +659,19 @@ special case of local redirection, it works only with socks proxy. In case of local redirection request is redirected to different service, ftp locally redirects to ftppr pop3 locally redirects to pop3p -http locally redurects to proxy admin locally -redirects to admin -s service.
+http locally redirects to proxy admin locally +redirects to the admin -s service. -Main purpose of
-local redirections is to have requested resource (URL or
-POP3 username) logged and protocol-specific filters to be
-applied. In case of local redirection ACLs are revied twice:
-first, by SOCKS proxy up to ´parent´ command and
-then with gateway service connection is redirected (HTTP,
-FTP or POP3) after ´parent´ command. It means,
-additional ´allow´ command is required for
-redirected requests, for example:
+
Main purpose of
+local redirections is to have the requested resource (URL or
+POP3 username) logged and protocol-specific filters applied.
+In case of local redirection, ACLs are reviewed twice:
+first, by the SOCKS proxy up to the ´parent´
+command and then by the gateway service the connection is
+redirected to (HTTP, FTP or POP3) after the
+´parent´ command. It means an additional
+´allow´ command is required for redirected
+requests, for example:
allow * * * 80
parent 1000 http 0.0.0.0 0
allow * * * 80 HTTP_GET,HTTP_POST
@@ -685,20 +680,20 @@ redirects all SOCKS requests with target port 80 to local
HTTP proxy, local HTTP proxy parses requests and allows only
GET and POST requests.
parent 1000 http 1.2.3.4 0
-Changes external address for given connection to 1.2.3.4 (an
-equivalent to -e1.2.3.4)
+Changes the external address for a given connection to
+1.2.3.4 (equivalent to -e1.2.3.4)
Optional username and password are used to authenticate on
parent proxy. Username of ´*´ means username
must be supplied by user.
nolog +
nolog
<n>
extends last allow or deny command to prevent logging, e.g.
allow * * 192.168.1.1
nolog
weight +
weight
<n>
extends last allow or deny command to set weight for this
request
@@ -706,7 +701,7 @@ allow * * 192.168.1.1
weight 100
Weight may be used for different purposes.
force
+
force
noforce
If force is specified for service, configuration reload will
require all current sessions of this service to be
@@ -716,7 +711,7 @@ closed. noforce allows to keep previously authenticated
connections.
bandlimin +
bandlimin
<rate> <userlist> <sourcelist>
<targetlist> <targetportlist>
<operationlist> <weekdayslist>
@@ -733,30 +728,31 @@ nobandlimout <userlist> <sourcelist>
<targetlist> <targetportlist>
<operationlist> <weekdayslist>
<timeperiodslist>
-bandlim sets bandwith limitation filter to <rate> bps
-(bits per second) If you want to specife bytes per second -
-multiply your value to 8. bandlim rules act in a same manner
-as allow/deny rules except one thing: bandwidth limiting is
-applied to all services, not to some specific service.
-bandlimin and nobandlimin applies to incoming traffic
-bandlimout and nobandlimout applies to outgoing traffic If
-tou want to ratelimit your clients with IPs 192.168.10.16/30
-(4 addresses) to 57600 bps you have to specify 4 rules like
-
+bandlim sets a bandwidth limitation filter to <rate>
+bps (bits per second). If you want to specify bytes per
+second, multiply your value by 8. bandlim rules act in the
+same manner as allow/deny rules, except for one thing:
+bandwidth limiting is applied to all services, not to some
+specific service. bandlimin and nobandlimin apply to
+incoming traffic
+bandlimout and nobandlimout apply to outgoing traffic
+If you want to ratelimit your clients with IPs
+192.168.10.16/30 (4 addresses) to 57600 bps, you have to
+specify 4 rules like
bandlimin 57600 * 192.168.10.16
bandlimin 57600 * 192.168.10.17
bandlimin 57600 * 192.168.10.18
bandlimin 57600 * 192.168.10.19
-and every of you clients will have 56K channel. If you
+and each of your clients will have a 56K channel. If you
specify
bandlimin 57600 * 192.168.10.16/30
-you will have 56K channel shared between all clients. if you
-want, for example, to limit all speed ecept access to POP3
-you can use
+you will have a 56K channel shared between all clients. If
+you want, for example, to limit all speed except access to
+POP3, you can use
nobandlimin * * * 110
before the rest of bandlim rules.
connlim +
connlim
<rate> <period> <userlist>
<sourcelist> <targetlist> <targetportlist>
<operationlist> <weekdayslist>
@@ -772,13 +768,13 @@ connections.
connlim 100 60 * 127.0.0.1
allows 100 connections per minute for 127.0.0.1.
connlim 20 0 * 127.0.0.1
-allows 20 simulationeous connections for 127.0.0.1.
-Like with bandlimin, if individual limit is required per
-client, separate rule mustbe added for every client. Like
-with nobanlimin, noconnlim adds an exception.
counter -<filename> <reporttype> <repotname> +
counter
+<filename> <reporttype> <reportname>
countin <number> <type> <limit>
<userlist> <sourcelist> <targetlist>
@@ -805,30 +801,32 @@ nocountall <userlist> <sourcelist>
<operationlist> <weekdayslist>
<timeperiodslist>
counter, -countin, nocountin, countout, noucountout, countall, -nocountall commands are used to set traffic limit in MB for -period of time (day, week or month). Filename is a path to a -special file where traffic information is permanently -stored. number is sequential number of record in this file. -If number is 0 this counter is not preserved in counter file -(that is if proxy restarted all counters with 0 are flushed) -overwise it should be unique sequential number which points -to position of the couter within the file. Type specifies a +
counter,
+countin, nocountin, countout, nocountout, countall,
+nocountall commands are used to set a traffic limit in MB
+for a period of time (day, week or month). Filename is a
+path to a special file where traffic information is
+permanently stored. The number is the sequential number of
+the record in this file. If the number is 0, this counter is
+not preserved in the counter file (that is, if the proxy is
+restarted, all counters with 0 are flushed); otherwise, it
+should be a unique sequential number which points to the
+position of the counter within the file. Type specifies a
type of counter. Type is one of:
-H - counter is resetted hourly
-D - counter is resetted daily
-W - counter is resetted weekly
-M - counter is resetted monthely
-reporttype/repotname may be used to generate traffic
-reports. Reporttype is one of D,W,M,H(hourly) and repotname
-specifies filename template for reports. Report is text file
-with counter values in format:
+H - counter is reset hourly
+D - counter is reset daily
+W - counter is reset weekly
+M - counter is reset monthly
+reporttype/reportname may be used to generate traffic
+reports. Reporttype is one of D, W, M, H (hourly) and
+reportname specifies the filename template for reports. The
+report is a text file with counter values in the format:
+
<COUNTERNUMBER> <TRAF>
The rest of parameters is identical to
bandlim/nobandlim.
users +
users
username[:pwtype:password] ...
pwtype is one of:
none (empty) - use system authentication
@@ -843,16 +841,21 @@ users test3:NT:BD7DFBF29A93F93C63CB84790DA00E63
| - |
Note: double quotes are required because the password +contains a $ sign.
+flush +
flush
-empty active access list. Access list must be flushed avery
-time you creating new access list for new service. For
-example:
+empty the active access list. The access list must be
+flushed every time you create a new access list for a new
+service. For example:
allow *
pop3p
flush
@@ -860,60 +863,61 @@ allow * 192.168.1.0/24
socks
sets different ACLs for pop3p and socks
system +
system
<command>
execute system command
pidfile +
pidfile
<filename>
write pid of current process to file. It can be used to
manipulate 3proxy with signals under Unix. Currently next
signals are available:
monitor +
monitor
<filename>
If file monitored changes in modification time or size,
3proxy reloads configuration within one minute. Any number
of files may be monitored.
setuid +
setuid
<uid>
calls setuid(uid), uid can be numeric or since 0.9 username.
Unix only. Warning: under some Linux kernels setuid() works
for current thread only. It makes it impossible to suid for
all threads.
setgid +
setgid
<gid>
calls setgid(gid), gid can be numeric or since 0.9
groupname. Unix only.
chroot +
chroot
<path> [<uid>] [<gid>]
calls chroot(path) and sets gid/uid. Unix only. uid/gid
supported since 0.9, can be numeric or
username/groupname
stacksize +
stacksize
<value_to_add_to_default_stack_size>
-Change default size for threads stack. May be required in
-some situation, e.g. with non-default plugins, on on some
-platforms (some FreeBSD version may require adjusting stack
-size due to invalid defined value in system header files,
-this value is also oftent reqruied to be changed for ODBC
-and PAM support on Linux. If you experience 3proxy crash on
-request processing, try to set some positive value. You may
-start with stacksize 65536 and then find the minimal value
-for service to work. If you experience memory shortage, you
-can try to experiment with negative values.
plugin +
plugin
<path_to_shared_library> <function_to_call>
[<arg1> ...]
Loads specified library and calls given export function with
@@ -924,19 +928,19 @@ function_to_call must return 0 in case of success, value
> 0 to indicate error.
filtermaxsize +
filtermaxsize
<max_size_of_data_to_filter>
If Content-length (or another data length) is greater than
-given value, no data filtering will be performed thorugh
+the given value, no data filtering will be performed through
filtering plugins to avoid data corruption and/or
-Content-Length chaging. Default is 1MB (1048576).
Report all bugs +
Report all bugs to 3proxy@3proxy.org
3proxy(8), +
3proxy(8),
proxy(8), ftppr(8), socks(8), pop3p(8), tcppm(8), udppm(8),
syslogd(8),
https://3proxy.org/
3APA3A is +
3APA3A is pronounced as ``zaraza´´.
3proxy is +
3proxy is designed by Vladimir 3APA3A Dubrovin (3proxy@3proxy.org)
3proxy - +
3proxy - 3[APA3A] tiny proxy server, or trivial proxy server, or free proxy server
@@ -35,7 +35,7 @@ proxy server -3proxy +
3proxy
[config_file]
3proxy [--install]
3proxy [--remove]
3proxy -is universal proxy server. It can be used to provide -internal users wuth fully controllable access to external -resources or to provide external users with access to -internal resources. 3proxy is not developed to replace -squid(8), but it can extend functionality of existing -cashing proxy. It can be used to route requests between -different types of clients and proxy servers. Think about it -as application level gateway with configuration like -hardware router has for network layer. It can establish +
3proxy is +a universal proxy server. It can be used to provide internal +users with fully controllable access to external resources +or to provide external users with access to internal +resources. 3proxy is not developed to replace +squid(8), but it can extend the functionality of an +existing caching proxy. It can be used to route requests +between different types of clients and proxy servers. Think +about it as application level gateway with configuration +like hardware router has for network layer. It can establish multiple gateways with HTTP and HTTPS proxy with FTP over HTTP support, SOCKS v4, v4.5 and v5, POP3 proxy, UDP and TCP -portmappers. Each gateway is started from configuration file -like independant service proxy(8) socks(8) -pop3p(8) tcppm(8) udppm(8) -ftppr(8) dnspr but 3proxy is not a kind -of wrapper or superserver for this daemons. It just has same -code compiled in, but provides much more functionality. -SOCKSv5 implementatation allows to use 3proxy with any UDP -or TCP based client applications designed without proxy -support (with SocksCAP, FreeCAP or another -client-side redirector under Windows of with socksification -library under Unix). So you can play your favourite games, -listen music, exchange files and messages and even accept -incoming connections behind proxy server.
+portmappers. Each gateway is started from the configuration +file like an independent service proxy(8) +socks(8) pop3p(8) tcppm(8) +udppm(8) ftppr(8) dnspr but +3proxy is not a kind of wrapper or superserver for +these daemons. It just has the same code compiled in, but +provides much more functionality. SOCKSv5 implementation +allows you to use 3proxy with any UDP or TCP based client +applications designed without proxy support (with +SocksCAP, FreeCAP or another client-side +redirector under Windows or with a socksification library +under Unix). So you can play your favourite games, listen to +music, exchange files and messages and even accept incoming +connections behind a proxy server. -dnspr -does not exist as independant service. It´ DNS caching -proxy (it requires nscache and nserver to be -set in configuration. Only A-records are cached. Please -note, the this caching is mostly a ’hack’ and -has nothing to do with real DNS server, but it works +
dnspr +does not exist as an independent service. It’s a DNS +caching proxy (it requires nscache and nserver +to be set in the configuration. Only A-records are cached. +Please note that this caching is mostly a ’hack’ +and has nothing to do with a real DNS server, but it works perfectly for SOHO networks.
-3proxy supports +
3proxy supports access control lists (ACL) like network router. Source and destination networks and destination port can be specified. In addition, usernames and gateway action (for example GET @@ -92,10 +93,10 @@ ACL action request can be allowed, denied or redirected to another host or to another proxy server or even to a chain of proxy servers.
-It supports +
It supports different types of logging: to logfiles, syslog(3) -(only under Unix) or to ODBC database. Logging format is -turnable to provide compatibility with existing log file +(only under Unix) or to an ODBC database. Logging format is +tunable to provide compatibility with existing log file parsers. It makes it possible to use 3proxy with IIS, ISA, Apache or Squid log parsers.
@@ -105,28 +106,28 @@ Apache or Squid log parsers. -config_file
+config_file
-Name of config file. See +
Name of config file. See
3proxy.cfg(3) for configuration file format. Under
Windows, if config_file is not specified, 3proxy
-looks for file named 3proxy.cfg in the default
-location (in same directory with executable file and in
-current directory). Under Unix, if no config file is
+looks for a file named 3proxy.cfg in the default
+location (in the same directory as the executable file and
+in the current directory). Under Unix, if no config file is
specified, 3proxy reads configuration from stdin. It makes
-it possible to use 3proxy.cfg file as executable script just
-by setting +x mode and adding
+it possible to use the 3proxy.cfg file as an executable
+script just by setting +x mode and adding
#!/usr/local/3proxy/3proxy
as a first line in 3proxy.cfg
--install
+--install
-(Windows NT family only) +
(Windows NT family only) install 3proxy as a system service
---remove
+--remove
-(Windows NT family only) remove +
(Windows NT family only) remove 3proxy from system services
Under Unix
-there are few signals 3proxy catches. See
-kill(1).
+
Under Unix there
+are a few signals 3proxy catches. See kill(1).
+
SIGTERM
cleanup connections and +
clean up connections and exit
-SIGPAUSE
+SIGPAUSE
-stop to accept new connections, +
stop accepting new connections, on second signal - start and re-read configuration
-SIGCONT
+SIGCONT
-start to accept new -conenctions
+start to accept new +connections
-SIGUSR1
+SIGUSR1
-reload configuration
+reload configuration
-Under Windows,
-if 3proxy is installed as service you can standard
-service management to start, stop, pause and continue 3proxy
-service, for example:
+
Under Windows,
+if 3proxy is installed as a service you can use
+standard service management to start, stop, pause and
+continue the 3proxy service, for example:
net start 3proxy
net stop 3proxy
net pause 3proxy
net continue 3proxy
Web admin +
Web admin service can also be used to reload configuration. Use wget to automate this task.
@@ -175,10 +176,10 @@ to automate this task. -/usr/local/3proxy/3proxy.cfg +
/usr/local/3proxy/3proxy.cfg (3proxy.cfg)
-3proxy configuration +
3proxy configuration file
Report all bugs +
Report all bugs to 3proxy@3proxy.org
3proxy.cfg(3), +
3proxy.cfg(3),
proxy(8), ftppr(8), socks(8), pop3p(8), tcppm(8), udppm(8),
kill(1), syslogd(8),
https://3proxy.org/
3APA3A is +
3APA3A is pronounced as ``zaraza´´.
3proxy is +
3proxy is designed by Vladimir 3APA3A Dubrovin (3proxy@3proxy.org)
Precaution 1: 3proxy was not initially developed for high load and is positioned as a SOHO product, the main reason is "one connection - one thread" model 3proxy uses. 3proxy is known to work with above 200,000 connections under proper configuration, but use it in production environment under high loads at your own risk and do not expect too much. -
Precaution 2: This documentation is incomplete and is not sufficient. High loads may require very specific system tuning including, but not limited to specific or cusomized kernels, builds, settings, sysctls, options, etc. All this is not covered by this documentation. +
Precaution 1: 3proxy was not initially developed for high load and is positioned as a SOHO product. The main reason is the "one connection - one thread" model 3proxy uses. 3proxy is known to work with over 200,000 connections under proper configuration, but use it in a production environment under high loads at your own risk and do not expect too much. +
Precaution 2: This documentation is incomplete and insufficient. High loads may require very specific system tuning including, but not limited to, specific or customized kernels, builds, settings, sysctls, options, etc. All of this is not covered by this documentation.
maxconn 1000 proxy -p3129 @@ -14,53 +14,53 @@ proxy -p3128 socksmaxconn for every service is 1000, and there are 3 services running -(2 proxy and 1 socks), so, for all services there can be up to 3000 -simulatineous connections to 3proxy. -
Avoid setting 'maxconn' to arbitrary high value, it should be carefully -choosen to protect system and proxy from resources exhaution. Setting maxconn -above resources available can lead to denial of service conditions. -
Avoid setting 'maxconn' to an arbitrarily high value; it should be carefully +chosen to protect the system and proxy from resource exhaustion. Setting maxconn +above available resources can lead to denial of service conditions. +
cat /proc/PID/limits-where PID is a pid of the process. -Validate ulimits match your expectation, especially if you run 3proxy under dedicated account -by adding e.g. +where PID is the process ID. +Validate that ulimits match your expectations, especially if you run 3proxy under a dedicated account +by adding, e.g.:
system "ulimit -Ha >>/tmp/3proxy.ulim.hard" system "ulimit -Sa >>/tmp/3proxy.ulim.soft"-in the beginning (before first service started) and the end of config file. -Make both hard restart (that is kill and start 3proxy process) and soft restart -by sending SIGUSR1 to 3proxy process, check ulimits recorded to files match your -expecation. In systemd based distros (e.g. latest Debian / Ubuntu) changing limits.conf -is not enough, limits must be ajusted in systemd configuration, e.g. by setting +at the beginning (before the first service is started) and at the end of the config file. +Perform both a hard restart (i.e., kill and start the 3proxy process) and a soft restart +by sending SIGUSR1 to the 3proxy process; check that the ulimits recorded to files match your +expectations. In systemd-based distros (e.g., latest Debian/Ubuntu), changing limits.conf +is not enough; limits must be adjusted in the systemd configuration, e.g., by setting:
DefaultLimitDATA=infinity DefaultLimitSTACK=infinity @@ -73,51 +73,51 @@ DefaultLimitMEMLOCK=infinityin user.conf / system.conf -
-To help with socket-based system-dependant settings, since 0.9-devel 3proxy supports different -socket options which can be set via -ol option for listening socket, -oc for proxy-to-client -socket and -os for proxy-to-server socket. Example: +To help with socket-based system-dependent settings, since 0.9-devel, 3proxy supports different +socket options which can be set via the -ol option for the listening socket, -oc for the proxy-to-client +socket, and -os for the proxy-to-server socket. Example:
proxy -olSO_REUSEADDR,SO_REUSEPORT -ocTCP_TIMESTAMPS,TCP_NODELAY -osTCP_NODELAY-available options are system dependant. +Available options are system-dependent. -
+If 3proxy is used in a VPS environment, there can be additional limitations. +For example, kernel resources, system CPU usage, and IOCTLs can be limited differently, and this can become a bottleneck. +Since 0.9-devel, 3proxy uses splice() by default on Linux. splice() prevents network traffic from being copied from +kernel space to the 3proxy process and generally increases throughput, especially in the case of high-volume traffic. This is especially +true for virtual environments (it can improve throughput up to 10 times) unless there are additional kernel limitations. +Since some work is moved to the kernel, it requires up to 2 times more kernel resources in terms of CPU, memory, and IOCTLs. +If your hosting additionally limits kernel resources (you can see this as nearly 100% CPU usage without any real CPU activity for +any application performing IOCTLs), use the -s0 option to disable splice() usage for a given service, e.g.: +socks -s0-Extending ephemeral port range
+Extending the Ephemeral Port Range
-Check ephemeral port range for your system and extend it to the number of the +Check the ephemeral port range for your system and extend it to the number of ports required. -Ephimeral range is always limited to maximum number of ports (64K). To extend the -number of outgoing connections above this limit, extending ephemeral port range -is not enough, you need additional actions: +The ephemeral range is always limited to the maximum number of ports (64K). To extend the +number of outgoing connections above this limit, extending the ephemeral port range +is not enough; you need additional actions:-
- Configure multiple outgoing IPs -
- Make sure 3proxy is configured to use different outgoing IP by either setting -external IP via RADIUS +
- Make sure 3proxy is configured to use a different outgoing IP by either setting +the external IP via RADIUS:
radius secret 1.2.3.4 auth radius proxyor by using multiple services with different external -interfaces, example: +interfaces, for example:allow user1,user11,user111 proxy -p1111 -e1.1.1.1 @@ -133,7 +133,7 @@ proxy -p4444 -e4.4.4.4 flushor via "parent extip" rotation, -e.g. +e.g.:allow user1,user11,user111 parent 1000 extip 1.1.1.1 0 @@ -156,8 +156,8 @@ socks-Under latest Linux version you can also start multiple services with different -external addresses on the single port with SO_REUSEPORT on listening socket to +Under the latest Linux versions, you can also start multiple services with different +external addresses on a single port with SO_REUSEPORT on the listening socket to evenly distribute incoming connections between outgoing interfaces:socks -olSO_REUSEPORT -p3128 -e 1.1.1.1 @@ -165,136 +165,136 @@ socks -olSO_REUSEPORT -p3128 -e 2.2.2.2 socks -olSO_REUSEPORT -p3128 -e 3.3.3.3 socks -olSO_REUSEPORT -p3128 -e 4.4.4.4-for Web browsing last two examples are not recommended, because same client can get -different external address for different requests, you should choose external +For web browsing, the last two examples are not recommended because the same client can get +a different external address for different requests; you should choose the external interface with user-based rules instead. -- You may need additional system dependant actions to use same port on different IPs, -usually by adding SO_REUSEADDR (SO_PORT_SCALABILITY for Windows) socket option to -external socket. This option can be set (since 0.9 devel) with -os option: +
- You may need additional system-dependent actions to use the same port on different IPs, +usually by adding the SO_REUSEADDR (SO_PORT_SCALABILITY for Windows) socket option to +the external socket. This option can be set (since 0.9-devel) with the -os option:
proxy -p3128 -e1.2.3.4 -osSO_REUSEADDR-Behavior for SO_REUSEADDR and SO_REUSEPORT is different between different system, -even between different kernel versions and can lead to unexpected results. -Specifics is described here. -Use this options only if actually required and if you fully understand possible -consiquences. E.g. SO_REUSEPORT can help to establish more connections than the -number of the client port available, but it can also lead to situation connections -are randomely fail due to ip+port pairs collision if remote or local system +The behavior for SO_REUSEADDR and SO_REUSEPORT is different between different systems, +even between different kernel versions, and can lead to unexpected results. +The specifics are described here. +Use these options only if actually required and if you fully understand the possible +consequences. For example, SO_REUSEPORT can help establish more connections than the +number of client ports available, but it can also lead to situations where connections +randomly fail due to IP+port pair collisions if the remote or local system doesn't support this trick.Setting stacksize
+Setting Stack Size
'stacksize' is a size added to all stack allocations and can be both positive and -negative. Stack is required in functions call. 3proxy itself doesn't require large +negative. Stack is required for function calls. 3proxy itself doesn't require a large stack, but it can be required if some -purely-written libc, 3rd party libraries or system functions called. There is known\ +poorly written libc, 3rd party libraries, or system functions are called. There is known dirty code in Unix ODBC -implementations, build-in DNS resolvers, especially in the case of IPv6 and large -number of interfaces. Under most 64-bit system extending stacksize will lead -to additional memory space usage, but do not require actual commited memory, -so you can inrease stacksize to relatively large value (e.g. 1024000) without -the need to add additional phisical memory, -but it's system/libc dependant and requires additional testing under your -installation. Don't forget about memory related ulimts. -For 32-bit systems address space can be a bottlneck you should consider. If -you're short of address space you can try to use negative stack size. +implementations and built-in DNS resolvers, especially in the case of IPv6 and a large +number of interfaces. Under most 64-bit systems, extending stacksize will lead +to additional memory space usage but does not require actual committed memory, +so you can increase stacksize to a relatively large value (e.g., 1024000) without +the need to add additional physical memory, +but it's system/libc dependent and requires additional testing under your +installation. Don't forget about memory-related ulimits. +
For 32-bit systems, address space can be a bottleneck you should consider. If +you're short on address space, you can try using a negative stack size. -
Known system issues
+Known System Issues
-There are known race condition issues in Linux / glibc resolver. The probability -of race condition arises under configuration with IPv6, large number of interfaces -or IP addresses or resolvers configured. In this case, install local recursor and -use 3proxy built-in resolver (nserver / nscache / nscache6). -Do not use public resolvers
-Public resolvers like ones from Google have ratelimits. For large number of -requests install local caching recursor (ISC bind named, PowerDNS recursor, etc). +There are known race condition issues in the Linux/glibc resolver. The probability +of a race condition arises under configuration with IPv6, a large number of interfaces +or IP addresses, or with resolvers configured. In this case, install a local recursor and +use 3proxy's built-in resolver (nserver / nscache / nscache6). +Do Not Use Public Resolvers
+Public resolvers like those from Google have rate limits. For a large number of +requests, install a local caching recursor (ISC bind named, PowerDNS recursor, etc). -Avoid large lists
+Avoid Large Lists
Currently, 3proxy is not optimized to use large ACLs, user lists, etc. All lists -are processed lineary. In devel version you can use RADIUS authentication to avoid -user lists and ACLs in 3proxy itself. Also, RADIUS allows to easily set outgoing IP -on per-user basis or more sophisicated logics. -RADIUS is a new beta feature, test it before using in production. +are processed linearly. In the devel version, you can use RADIUS authentication to avoid +user lists and ACLs in 3proxy itself. Also, RADIUS allows you to easily set an outgoing IP +on a per-user basis or implement more sophisticated logic. +RADIUS is a new beta feature; test it before using it in production. -Avoid changing configuration too often
+Avoid Changing Configuration Too Often
-Every configuration reload requires additional resources. Do not do frequent -changes, like users addition/deletaion via connfiguration, use alternative +Every configuration reload requires additional resources. Do not make frequent +changes, such as user addition/deletion via configuration; use alternative authentication methods instead, like RADIUS. -Consider using 'noforce'
+Consider Using 'noforce'
-'force' behaviour (default) re-authenticates all connections after -configuration reload, it may be resource consuming on large number of -connections. Consider adding 'noforce' command before services started -to prevent connections reauthentication. +The 'force' behavior (default) re-authenticates all connections after +configuration reload; it may be resource-consuming with a large number of +connections. Consider adding the 'noforce' command before services are started +to prevent connection re-authentication. -Do not monitor configuration files directly
+Do Not Monitor Configuration Files Directly
-Using configuration file directly in 'monitor' can lead to race condition where -configuration is reloaded while file is being written. +Using a configuration file directly in 'monitor' can lead to a race condition where +the configuration is reloaded while the file is being written. To avoid race conditions:-
- Update config files only if there is no lock file -
- Create lock file then 3proxy configuration is updated, e.g. with +
- Create a lock file when the 3proxy configuration is updated, e.g., with "touch /some/path/3proxy/3proxy.lck". If you generate config files -asynchronously, e.g. by user's request via web, you should consider -implementing existance checking and file creation as atomic operation. -
- add +asynchronously, e.g., by a user's request via web, you should consider +implementing existence checking and file creation as an atomic operation. +
- Add
system "rm /some/path/3proxy/3proxy.lck"-at the end of config file to remove it after configuration is successfully loaded -- Use a dedicated version file to monitor, e.g. +at the end of the config file to remove it after the configuration is successfully loaded +
- Use a dedicated version file to monitor, e.g.:
monitor "/some/path/3proxy/3proxy.ver"-- After config is updated, change version file for 3proxy to reload configuration, -e.g. with "touch /some/path/3proxy/3proxy.ver". +
- After the config is updated, change the version file for 3proxy to reload the configuration, +e.g., with "touch /some/path/3proxy/3proxy.ver".
Use TCP_NODELAY to speed-up connections with small amount of data
+Use TCP_NODELAY to Speed Up Connections with Small Amounts of Data
-If most requests require exchange with a small amount of data in a both ways -without the need for bandwidth, e.g. messengers or small web request, -you can eliminate Nagle's algorithm delay with TCP_NODELAY flag. Usage example: +If most requests require an exchange with a small amount of data in both directions +without the need for bandwidth, e.g., messengers or small web requests, +you can eliminate Nagle's algorithm delay with the TCP_NODELAY flag. Usage example:proxy -osTCP_NODELAY -ocTCP_NODELAYsets TCP_NODELAY for client (oc) and server (os) connections. -Do not use TCP_NODELAY on slow connections with high delays and then +
Do not use TCP_NODELAY on slow connections with high delays when connection bandwidth is a bottleneck. -
Use splice to speedup large data amount transfers
+Use Splice to Speed Up Large Data Amount Transfers
-splice() allows to copy data between connections without copying to process -addres space. It can speedup proxy on high bandwidth connections, if most +splice() allows copying data between connections without copying to the process +address space. It can speed up the proxy on high-bandwidth connections if most connections require large data transfers. Splice is enabled by default on Linux -since 0.9, "-s0" disables splice usage. Example: +since 0.9; "-s0" disables splice usage. Example:proxy -s0-Splice is only available on Linux. Splice requires more system buffers and file descriptors, +Splice is only available on Linux. Splice requires more system buffers and file descriptors and produces more IOCTLs but reduces process memory and overall CPU usage. -Disable splice if there is a lot of short-living connections with no bandwidth +Disable splice if there are a lot of short-lived connections with no bandwidth requirements. -Use splice only on high-speed connections (e.g. 10GBE), if processor, memory speed or +
Use splice only on high-speed connections (e.g., 10GbE) when the processor, memory speed, or system bus are bottlenecks. -
TCP_NODELAY and splice are not contrary to each over and should be combined on +
TCP_NODELAY and splice are not contrary to each other and should be combined on high-speed connections. -
Add grace delay to reduce system calls
+
Add Grace Delay to Reduce System Calls
proxy -g8000,3,10-First parameter is average read size we want to keep, second parameter is -minimal number of packets in the same direction to apply algorythm, -last value is delay added after polling and prior to reading data. -An example above adds 10 millisecond delay before reading data if average -polling size is below 8000 bytes and 3 read operations are made in the same -direction. It's specially usefule with splice.logdump 1 1is useful -to see how grace delays work, choose delay value to avoid filling the read -pipe/buffer (typically 64K) but keep the request sizes close to chosen average -on large file upload/download. +The first parameter is the average read size we want to keep, the second parameter is +the minimal number of packets in the same direction to apply the algorithm, +and the last value is the delay added after polling and prior to reading data. +The example above adds a 10-millisecond delay before reading data if the average +polling size is below 8000 bytes and 3 read operations have been made in the same +direction. It's especially useful with splice.logdump 1 1is useful +to see how grace delays work; choose a delay value to avoid filling the read +pipe/buffer (typically 64K) but keep the request sizes close to the chosen average +on large file uploads/downloads. diff --git a/How-To-(incomplete).md b/How-To-(incomplete).md deleted file mode 100644 index 3f4152b..0000000 --- a/How-To-(incomplete).md +++ /dev/null @@ -1,1073 +0,0 @@ --
- 3APA3A 3proxy tiny proxy server HowTo -
Under construction, very incomplete --
-- Compilation - -
- Proxy server installation and removal - -
- Server configuration -
-
-- How to make 3proxy start
-- How to make limitation (access, bandwidth, traffic, connections) work
-- How to make 3proxy to run as a service
-- How to understand internal and external
-- How to make ODBC logging work?
-- How to make IPv6 work
-- How to fix 3proxy crashes
-- Where to find configuration example -
- How to set up logging -
- How to setup logging format -
- How to use log analizers with 3proxy -
- How to start any of proxy services (HTTP, SOCKS etc) -
- How to bind service to specific interface or port -
- How to resolve names through a parent proxy
-- How to setup FTP proxy
-- How to setup SNI proxy (tlspr)
-- How to limit service access -
- How to create user list -
- How to limit user access to resources -
- How to manage redirections -
- How to manage local redirections -
- How to balance traffic between few external channgels? -
- How to manage proxy chains -
- How to limit bandwidth -
- How to limit traffic amount -
- How to fix incorrect traffic accounting -
- How to build network lists -
- How to configure name resolution and DNS caching -
- How to use IPv6 -
- How to use connect back -
- Client configuration -
- Administering and information analisys - -
- How To ask quiestion not in How To? -
--
-
-- Compilation -
-
-
- How to compile 3proxy with Visual C++ -
-Extract source code files from 3proxy.tgz (with WinZip or another utility). -Use nmake /f Makefile.msvc command -
-- How to compile 3proxy with Intel C Compiler under Windows -
-See How to compile 3proxy with Visual C++ -Use Makefile.intl instead of Makefile.msvc -
-- How to compile 3proxy with GCC under Windows
--Extract source files from 3proxy.tgz (for example with tar -xzf 3proxy.tgz command if you have tar installed) -Use make -f Makefile.win command. -If you want to use POSIX emulation Cygwin library (normally you shouldn't) - use make -f Makefile.unix instead. -Windows specific things (like installing as service) will not be available if compiled with Cygwin emulation. -
-- How to compile 3proxy with GCC under Unix/Linux
--Use -
-make -f Makefile.Linux --for Linux or Cygwin, Makefile.Solaris* (depending on compiler version) for Solaris -and Makefile.unix for different Unix-like OS. On BSD derivered systems make -sure to use GNU make, sometimes it's called gmake instead of make. -
Compilation is tested under FreeBSD/i386, NetBSD/i386, OpenBSD/i386, -RH Linux/Alpha, Debian/i386, Gentoo/i386, Gentoo/PPC, Solaris/x86 but you -shouldn't have problems under different Solaris, BSD or linux compatible systems. -For different systems you may be required to patch Makefile or even source codes. -If you want to use ODBC support, make sure to install ODBC for unix, remove -DNOODBC -option from makefile compiler options and add ODBC library to linker variable. - -
-- Proxy server installation and removal -
-
-
-- How to install/remove 3proxy under Windows NT/2000/XP -
-Unpack 3proxy.zip to any directory, for example -c:\Program Files\3proxy. If needed, create directory for storing log files, -ODBC sources, etc. Create 3proxy.cfg in the 3proxy installation directory (See Server configuration). -If you use 3proxy before 0.6 Add -
-service --string into 3proxy.cfg. Now, start command prompt (cmd.exe). -Change directory to 3proxy installation and run 3proxy.exe --install: --D:\>C: -C:\>cd C:\Program Files\3proxy -C:\Program Files\3proxy>3proxy.exe --install --Now, you should have 3proxy service installed and running. If service is not -started, remove "service" string from 3proxy.cfg, run 3proxy.exe manually -and correct all errors. --To remove 3proxy run 3proxy --remove: -
-D:\>C: -C:\>cd C:\Program Files\3proxy -C:\Program Files\3proxy>net stop 3proxy -C:\Program Files\3proxy>3proxy.exe --remove --Now you can simply remove 3proxy installation directory. - -- How to install/remove 3proxy under Windows 95/98/ME -
-Unpack 3proxy.zip to any directory, for example -c:\Program Files\3proxy. If needed, create directory for storing log files, -ODBC sources, etc. Create 3proxy.cfg in the 3proxy installation directory (See Server configuration). -Remove string -
-service --from 3proxy.cfg and add --daemon --if you want 3proxy to run in background. -Create shortcut for 3proxy.exe and place it in autostart or add -to registry with regedit.exe: -
HKLM\Software\Microsoft\Windows\CurrentVersion\Run -Type: String -
3proxy = "c:\Program Files\3proxy.exe" "C:\Program Files\3proxy.cfg"
-You must use quotes if path contains space. If neccessary, restart Windows. -If service is not started, check log. Remove "daemon" command from 3proxy.cfg, -start 3proxy.exe manually and correct all errors. - -- How to install/remove 3proxy under Unix/Linux -
-Complie 3proxy (see Compilation). Copy -executables to any appropriate location (for example /usr/local/3proxy/sbin -for servers and /usr/local/3proxy/bin for utilities). -Create /usr/local/etc/3proxy.cfg. -(see Server configuration). -You can change default configuration file location by specifing configuration file -in 3proxy command line. -Add 3proxy to system startup scripts. -
-
-- Server configuration -
-
-
- How to make 3proxy start -
Valid configuration file is required. - -
- How to make limitation (access, bandwidth, traffic, connections) work -
Most probable reasons for non-working limitations: 'auth none' or no auth is used. For any ACL based feature one of 'iponly', 'nbname' or 'strong' auths required. Sequence of commands may be invalid. Commands are executed one-by-one and 'proxy', 'tcppm', 'socks' or another service commands must follow valid configuration. Invalid sequence of ACLs. First matching ACL is used (except of internal redirections, see below). If ACL contains at least one records last record is assumed to be 'deny *'. - -
- How to make 3proxy to run as a service -
Possible reasons for 3proxy starts manually but fails to start as a service: -
-
- -- there are relative paths in configuration file for included files, -log files, etc. Always use absolute paths. For example -$"c:\3proxy\networks.local" instead of $networks.local. For debugging remove -'service' and 'daemon', log to stdout an try to execute 3proxy from command -line from some different directory (for example from disk root). -
- SYSTEM account doesn't have access to executable file, configuration files, -log files, etc. -
- configuration files is not located in default path (3proxy.cfg in same -location with 3proxy.exe). For alternative configuration file location use -
-3proxy --install full_path_to_configuration_file --- user has no rights to install or start service -
- service is already installed and/or started - -
How to understant internal and external -
-Both internal and external IPs are IPs of the host running 3proxy itself. -This configuration option is usefull in situation 3proxy is running on the -border host with 2 (or more) connections: e.g. LAN and WAN with different IPs -
- LAN connection +-------------+ Internet connection -LAN <-------------->| 3proxy host |<-------------------> INTERNET - ^+-------------+^ - | | - Internal IP External IP --If 3proxy is used on the host with single connection, both internal and -external are usually same IP. -
Internal should exist and be UP on the moment 3proxy is started and -should never be disconnected/DOWN. If this interface is periodically -disconnected (e.g. direct link between 2 hosts), do not specify internal -address or use 0.0.0.0 instead. In this case, if you have 2 or more -interfaces you must use firewall (preferably) or 3proxy ACLs to avoid open -proxy situation. -
-External IP (if specified) must exist in the momet 3proxy -serves client request. If external interface is no specified (or 0.0.0.0), -system select external IP. It may be possible to access resources of internal -network, to prevent this use ACLs. In addition, SOCKSv5 will not support BIND -operation, required for incoming connections (this operation is quite rarely -implemented in SOCKSv5 clients and usually is not required). In case of -dynamic address, do not specify external or use external 0.0.0.0 or, if -external address is required, create a script to determine current external -IP and save it to file, and use external "$path_to_file" with "monitor" command -to automatically reload configuration on address change. - -- How to make ODBC logging work? -
-Check you use system DSN. -Check SQL request is valid. -The best way to check is to make file or stdout logging, get SQL request from log file or console and execute this request manually. -Under Unix, you may also want to adjust 'stacksize' parameter. - -
- How to make IPv6 work -
Proxy can not access destination directly over IPv6 if client requests IPv4 address. -To access IPv6 destination, either IPv6 address or hostname must be used in request. -Best solution is to enable option to resolve hostnames via proxy on client side. - -
- How to fix 3proxy crashes -
default stacksize may be insufficient, if some non-default plugins - are used (e.g. PAM and ODBC on Linux) or if compiled on some platforms with - invalid system defined values (few versionds of FreeBSD on amd64). - Problem can be resolved with 'stacksize' command or '-S' option starting 3proxy 0.8.4. - - -
- Where to find configuration example -
-Server configuration example 3proxy.cfg.sample is in any 3proxy distribution. -
-- How to set up logging -
-3proxy can log to stdout, file, ODBC datasource and -syslog (Unix/Linux/Cygwin only). For using ODBC under Unix/Linux you must -compile 3proxy with Unix ODBC libraries, see Compilation. -You can control logging from 3proxy.cfg for all services or you can control -logging of individual service, for example -/usr/local/sbin/socks -l/var/log/socks.log starts SOCKS proxy with logging to file. -For universal proxy (3proxy) log file rotation and archiving is supported. -Log type is defined with "log" configuration file command or with --l switch on individual service invokation. log or -l is stdout logging. -
- log filename --and -- -lfilename --specify filename for logging -- log @ident --and -- -l@ident --specify ident for syslog logging. If filename within "log" command contains -'%' characters, it's processes as format specificator (see "logformat"). E.g. -log c:\3proxy\logs\%y%m%d.log D creates file like c:\3proxy\logs\060729.log, -date is generated based on local time. -- log &connstring -- -specifies ODBC connection string, connstring is in format -datasource,username,password (2 last are optional of -datasource does not require or already has authentication information). -Also, you must specify logformat to build SQL query, to insert recod into -log, see How to setup logging format - --Rotation and archiving may be set up with log, rotate ¨ archiver commands -
- log filename LOGTYPE --sets rotation type. LOGTYPE may be: --
-- M, monthely -
- W, weekly -
- D, daily -
- H, hourly -
- C, minutely -
- rotate NUMBER -- specifies number of files in rotation (that is how many files to keep). -- archiver EXT COMMAND PARAMETERS -- Sets external archiver. EXT is extention of archived files - (for example zip, gz, Z, rar etc) COMMAND and PARAMETERS are command - to execute and command line PARAMETERS. Originale file is not deleted by - 3proxy, this work is left for archiver. - You can pass original filename to archiver with %F macro and archive filename with %A. - Examples are located in - 3proxy.cfg.sample - -- How to setup logging format -
- Since 0.3 version log format may be set with "logformat" command. - First symbol of log format specifies format of date and time and - should be L (LOCAL) or G (GMT - Grinwitch Meridian Time). Format - string may contains some macro substitutions: -
-
- Example: -- %y - Year (2 digits) -
- %Y - Year (4 digits) -
- %m - Month (2 digits) -
- %o - mOnth (3 letter abbriviation) -
- %d - Day (2 digits) -
- %H - Hour (2 digits) -
- %M - Minute (2 digits) -
- %S - Second (2 digits) -
- %t - Timestamp (seconds since January, 1 1970 00:00:00 GMT) -
- %. - Milliseconds -
- %z - Timezone in mail format (from GMT, '+' east, '-' west HHMM), For example Moscow winter time is +0300. -
- %U - Username ('-' if unknown). -
- %N - Service name (PROXY, SOCKS, POP3P, etc) -
- %p - Service port -
- %E - Error code (see. Log error codes reference) -
- %C - client IP -
- %c - client port -
- %R - target IP -
- %r - target port -
- %e - external IP address used to establish connection -
- %Q - requested IP -
- %q - requested port -
- %I - bytes received from target -
- %O - bytes sent to target -
- %n - host name from request -
- %h - hops before target (if redirection or chaning is used). - see How to use chains and parent proxies) -
- %T - service specific text (for example URL requested). %X-YT - where X and Y are positive numbers, only displays fields - (space delimited) X to Y of the text. An example is %1-2T. -
-logformat "L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T" -- generates something like --1042454727.0296 SOCK4.1080 000 3APA3A 127.0.0.1:4739 195.122.226.28:4739 505 18735 1 GET http://3proxy.org/ HTTP/1.1 - -
-
(no line breaks) -- If ODBC used, logformat should specify SQL command, - to insert record into log, for example -
-logformat "-\'+_GINSERT INTO proxystat VALUES (%t, '%c', '%U', %I)"-
(no line breaks) -
-\'+_ instructs to replace characters \ and ' with _ - -- How to use log analizers with 3proxy -
-Just make format of 3proxy logs compatible with format supported by your -favourite log analizer. Examples of compatible logformats are: -
-For Squid access.log: --"- +_G%t.%. %D %C TCP_MISS/200 %I %1-1T %2-2T %U DIRECT/%R application/unknown" -
-or, more compatible format without %D --"- +_G%t.%. 1 %C TCP_MISS/200 %I %1-1T %2-2T %U - DIRECT/%R application/unknown" --ISA 2000 proxy WEBEXTD.LOG (fields are TAB-delimited): --"- + L%C %U Unknown Y %Y-%m-%d %H:%M:%S - w3proxy 3PROXY - %n %R %r %D - %O %I http TCP %1-1T %2-2T - - - %E - - -" --ISA 2004 proxy WEB.w3c (fields are TAB-delimited): --"- + L%C %U Unknown %Y-%m-%d %H:%M:%S - 3PROXY - %n %R %r %D %O - %I http %1-1T %2-2T - %E - - - Internal External 0x0 Allowed" --ISA 2000/2004 firewall FWSEXTD.log (fields are TAB-delimited): --"- + L%C %U unnknown:0:0.0 N %Y-%m-%d - %H:%M:%S fwsrv 3PROXY - %n %R %r - %D %O %I %r TCP Connect - - - - %E - - - - -" --HTTPD standard log (Apache and others): --"-""+_L%C - %U [%d/%o/%Y:%H:%M:%S %z] ""%T"" %E %I" -
-or more compatible without error code --"-""+_L%C - %U [%d/%o/%Y:%H:%M:%S %z] ""%T"" 200 %I" -
-- How to start any of proxy services (HTTP, SOCKS etc) -
-3proxy is distributed in 2 variants: as a set of standalone modules (proxy, -socks, pop3p, tcppm, udppm) and as universal proxy server. These services are -absolutely independant, and if you use 3proxy you needn't any of standalone -modules. -
Standalone modules are only configurable via command line interface while -3proxy uses configuration file. Many functions, such as ODBC logging, log -rotation, access control, etc are only available in 3proxy, not in standalone -proxies. -Standalone module may be started from command line, for example: --$/sbin/socks -l/var/log/socks.log -i127.0.0.1 --Starts SOCKS server binded to localhost ip, port 1080 with logging to -/var/log/socks.log. -You can get help for any standalone service with -? command line option. --If 3proxy is used you should start all services in 3proxy.cfg file. 3proxy.cfg -is executed by 3proxy as a batch file. Example of 3proxy.cfg and command syntaxys -can be found in -3proxy.cfg.sample. -
-log /var/log/3proxy.log D -rotate 30 -internal 127.0.0.1 -external 192.168.1.1 -proxy -socks -p3129 -pop3p --Starts 3 services: HTTP PROXY, SOCKS and POP3 PROXY. Each listens localhost -interface with default port (3128 for HTTP, 1080 for SOCKS and 110 for POP3P) -except socks started with port 3129. -All logs are in file /var/log/3proxy.log (with daily date modification and -rotation). 30 last files are stored. - -- How to bind service to specific interface and port? -
--i options specifies internal interface, -p - listening port. No space are -allowed. To bind 'proxy' service to port 8080 on interfaces 192.168.1.1 -and 192.168.2.1 use -
-proxy -p8080 -i192.168.1.1 -proxy -p8080 -i192.168.2.1 -- -- How to resolve names through a parent proxy
-- A: Use one of proxy, connect+, socks4+ or socks5+ as a parent type. 3proxy - itself still performs a name resolution, it's required e.g. to ACLs matching. - So, if no name resolution must be performed by 3proxy itself add a command -
- fakeresolve- this command resolves any name to 127.0.0.2 address. - -- How to setup FTP proxy
-- There is FTP over HTTP (what is called FTP proxy in browsers) and FTP over FTP ¯பᨠ- (what is called FTP proxy in file managers and FTP clients). For browsers, there is no need to start additional - proxy service, 'proxy' supports FTP over HTTP, configure 'proxy' port as an FTP proxy. For ftp clients and file - managers use ftppr. FTP proxy supports both active and passive mode with client, but always use passive mode with FTP servers. -
-- How to setup SNI proxy (tlspr)
-- SNI proxy can be used to transparently redirect any TLS traffic with external router or local redirection rules. It can also be used - to extract hostnames from TLS to use in ACLs in combination with SOCKS or HTTP(s) proxy and/or Transparent plugin. It can also be used to require TLS or mTLS between services. TLS hadshake contains no - port information, if tlspr is used as a standalone service, destination port may be either detected with Transparent plugin or configured with -P option (default 443). -
- -c option is used to specify level of TLS check: -
-0 (default) - allow non-TLS traffic -1 - require TLS, only check client HELLO packet -2 - require TLS, check both client and server HELLO -3 - require TLS, check server send certificate (not compatible with TLS 1.3) -4 - require mutual TLS, check server send certificate request and client sends certificate (not compatible with TLS 1.3) ---configuration examples: -1. port 1443 may be used to redirect traffic to destination port 143). SNI is used to find destination host -
-tlspr -p1443 -P443 -c1 --2. used as parent tls to detect destination hostname from TLS in socks --allow * * * 80 -parent 1000 http 0.0.0.0 0 -allow * * * * CONNECT -parent 1000 tls 0.0.0.0 0 -deny * * some.not.allowed.host -allow * -socks -- -
-First, always specify internal interface to accept incoming connection with -'internal' configuration command or '-i' service command. (See -How to start any of proxy services (HTTP, SOCKS etc)). If -no internal interface is specified your proxy will act as open one. -
It's also important to specify external interface to prevent access to -internal network with 'external' or -e. -
3proxy with configuration files allows to use authentication and -authorization for user's access. Authentication is possible by -username/password or user's NetBIOS name. Authentication type is specified by -'auth' command. -
-auth none --Disables both authentication and authorization. You can not use ACLs. -
-auth iponly --Specifies no authentication, ACLs authorization is used. -
-auth nbname --Authentication by NetBIOS name + ACLs. NetBIOS name of 'messenger' service -is obrained before ACL validation. If no name is obtained it's assumed to be -empty. Messenger is started by default in Windows NT/2000/XP. For Win9x -WinPopUP need to be launched. This type of authentication may be spoofed -by privileged local user. -
-auth strong --Authentication by username/password. If user is not registered his -access is denied regardless of ACLs. -
-Different services can have different authentication levels. -
-auth none -pop3p -auth iponly -proxy -auth strong -socks -- -It's possible to authorize access by client IP address, IP address or requested resource, -target port, time, etc after authentication. -(See How to limit resource access). -
Since 0.6 version double authentication is possible, e.g. -
-auth iponly strong -allow * * 192.168.0.0/16 -allow user1,user2 -proxy --strong authentication will only be used if ACL requires username to deside if -access must be granted. That is, in example, strong username authentication -is not required to access 192.168.0.0/16 -
0.6 version introduces authentication (username) caching to increase -productivity. It's recommended to use authentication caching with resource -or time consuming authentication types, such as nbname or external plugins -(WindowsAuthentication). -Caching can be set with 'authcache' command with 2 parameters: caching type -and caching time (in seconds). Caching type defines the type of cached access: -'ip' - after successful authentication all connections during caching time -from same IP are assigned to the same user, username is not requested. -"ip,user" - username is requested and all connections from the same IP are -assigned to the same user without actual authentication. "user" - same as above, -but IP is not checked. "user,password" - username and password are checked -against cached ones. For authentication special authentication type 'cache' -must be used. - Example: -
-authcache ip 60 -auth cache strong windows -proxy -n -- -Please note, that caching affects security. Never use caching for access to -critical resources, such as web administration. -
authcache can be used to bind user's sessions to ip with 'limit' option, with -
- autchcache ip,user,pass,limit 120 - auth cache strong- user will not be able to use more than a single IP during cache time (120 sec). - -
-Userslist is created with 'users' command. -
-users USERDESC ... --With a single command it's possible to define few users, or you -can use few 'users' commands. USERDESC is user description. Description -consists of three semicolon delimited parts - login, password type and -
-users admin:CL:bigsecret test:CL:password test1:CL:password1 -users "test2:CR:$1$lFDGlder$pLRb4cU2D7GAT58YQvY49." -users test3:NT:BD7DFBF29A93F93C63CB84790DA00E63 --Please note the usage of quotation sign: it's required to comment out $ sign -overwise used as a file inclusion macro. -Next password types are available: -
-users $/etc/.3proxypasswd --or -
-users $"c:\Program Files\3proxy\passwords" --It's possible to create NT and crypt passwords with mycrypt utility included -in distribution. -
-Commands allow, deny and flush are used to manage ACLs: -
-allow <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist> <weekdaylist> <timeperiodlist>
-
deny <userlist> <sourcelist> <targetlist> <weekdaylist> <timeperiodlist>
-
flush
-
-
-
-Redirections are usefull to e.g. forward requests from specific clients
-to different servers or proxy server. Additionally, redirections are usefull
-to convert proxy interface from ont format to another, e.g. requests from
-SOCKS proxy can be redirected to parent HTTP proxy, or SOCKSv5 client can be
-redirected to SOCKSv4 proxy.
-
Because 3proxy understand "transparent" web request, it can be used as an
-intermediate software between HTTP proxy and NAT server for transparent HTTP
-forwarding, because it can convert "Web server" request issued by client to
-"proxy request" required by proxy server. A simplest redirection is:
-
-auth iponly -allow * -parent 1000 http 192.168.1.1 3128 -proxy --All trafiic of HTTP proxy is redirected to parent proxy 192.168.1.1 port 3128. -
-auth iponly -allow * * * 80 -parent 1000 http 0.0.0.0 0 -allow * * * 21 -parent 1000 ftp 0.0.0.0 0 -allow * * * 110 -parent 1000 pop3 0.0.0.0 0 -socks --In this case all SOCKS traffic with destination port 80 is forwarded to local -'proxy' service, destination port 21 to 'ftppr' and 110 to 'pop3pr'. There is -no need to run these services expicitly. Local redirections are usefull if -you want to see and control via ACLs protocol specific parameters, e.g. -filenames requests thorugh FTP while clients are using SOCKS. - -
-
Q: What is it for?
-A: To have control based on request and to have URLs and another protocol specific parameters to be logged. - -Q: What are restrictions?
-A: It's hard to redirect services for non-default ports; Internet Explorer supports only SOCKSv4 with no password authentication (Internet Explorer sends username, but not password), for SOCKSv5 only cleartext password authentication is supported. - -Q: What are advantages?
-A: You need only to setup SOCKS proxy in browser settings. You can use socksifier, i.e. FreeCAP or SocksCAP with application which is not proxy aware. - -Q: How to setup?
-A: You should specify parent proxy with IP of 0.0.0.0 and port 0. Examples: --auth iponly -allow * * * 80,8080-8088 -parent 1000 http 0.0.0.0 0 -allow * * * 80,8080-8088 -#redirect ports 80 and 8080-8088 to local HTTP proxy -#Second allow is required, because ACLs are checked -#twice: first time by socks and second by http proxy. - -allow * * * 21,2121 -parent 1000 ftp 0.0.0.0 0 -allow * * * 21,2121 -#redirect ports 21 and 2121 to local -#ftp proxy - - -allow * -#allow rest of connections directly - -socks -#now let socks server to start -- -
Q: How it affects different ACL rules
-A: After local redirections rules are applied again to protocol-level request. Redirection rule itself is skipped. It makes it possible to redirect request again on the external proxy depending on request itself. --allow * * * 80,8080-8088 -parent 1000 http 0.0.0.0 0 -#redirect http traffic to internal proxy - -allow * * $c:\3proxy\local.nets 80,8080-8088 -#allow direct access to local.nets networks -allow * * * 80,8080-8088 -parent 1000 http proxy.3proxy.org 3128 -#use parent caching proxy for rest of the networks - -allow * -#allow direct connections for rest of socks -#requests -- -
-Proxy itself doesn't manage network level routing. The only way to control -outgoing channel is to select external interface. It's possible to make -external interface (what is usually selected with 'external' command or -'-e' option) random by using local redirection with external port 0. -
-auth iponly -allow * -parent 500 http 10.1.1.101 0 -parent 500 http 10.2.1.102 0 --Now external interface is randomly selected with 0.5 probability between -10.1.1.101 and 10.2.1.102. To work as expected, different default routes -must between 2 interfaces. -used -
-If both interface addresses are in same network, e.g. 10.1.1.101 and 10.1.1.102 -and you want to select random gateway between 10.1.1.1 and 10.1.1.2, you must -control it by using routing table, in case there is no default gateway route -for Windows: -
- route add -p 10.1.1.1 10.1.1.101 - route add -p 10.1.1.2 10.1.1.102 - route add -p 0.0.0.0 mask 0.0.0.0 192.168.1.1 - route add -p 0.0.0.0 mask 0.0.0.0 192.168.1.2 --If you have no second address yet, just add it. Under Linux/Unix it's better -to use source routing. - -
-parent command may also be used to build a proxy chains. In this case -few 'parent' commands are used for single 'allow' rule with different -weights (first argument of parent command). Chain may contain any number -of proxy servers, but it should be noted that every hope significantly -reduces productivity. It's possible to mix different types of proxy within -single chain: HTTPS (HTTP connect), SOCKS4, SOCKS5. Weight different from -1000 is used to build random chains. if weight W is below 1000, this proxy -will be used as a next chain hop with probability of W/1000. That is, if -the weight is 250 probability this proxy will be used for the next hope is -25%. 'parent' records with common weight of 1000 establish a group, one of -these record will be used for the hop with probability according to weight. -Warning: each group must have a weight even of 1000. As follows, common -weight of all 'parent' records must also be even of 1000. If common weight -of 'parent' records in te chain is 3000, chain has 3 hops and must be formed -of 3 groups. Example: -
-allow * -parent 500 socks5 192.168.1.1 1080 -parent 500 connect 192.168.10.1 3128 --In this case we have 1 parent proxy (1 hop) which is randomely choosen between -2 hosts: 192.168.1.1 and 192.168.10.1. 2 records form a single group. -
-allow * * * 80 -parent 1000 socks5 192.168.10.1 1080 -parent 1000 connect 192.168.20.1 3128 -parent 300 socks4 192.168.30.1 1080 -parent 700 socks5 192.168.40.1 1080 --In this case we have 3 groups (3 hops in the chain). First hop is 192.168.10.1, -second hop is 192.168.20.1 and 3rd one is either 192.168.30.1 with probability -of 30% or 192.168.40.1 with probability of 70%. - - -
-3proxy supports bandwidth filters. To manage filters bandlimin/bandlimout and -nobandlimin/nobandlimout. 'in' means incoming and 'out' - outgoing traffic. -
-bandlimin <bitrate> <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
-
nobandlimin <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
-
-
- bandlimin 57600 * 192.168.10.16 - bandlimin 57600 * 192.168.10.17 - bandlimin 57600 * 192.168.10.18 - bandlimin 57600 * 192.168.10.19 --Create 4 separete pipes for 4 client with emulation of modem connection. -
- bandlimin 57600 * 192.168.10.16/30 --Create single pipe for all 4 clients. That is 4 clients share modem connection. -In this example: -
- nobandlimin * * * 110 - bandlimin 57600 * 192.168.10.16/32 --mail traffic from POP3 servers bypasses the pipe and has no bandwidth -limitation. - -
-
-counter <filename> <type> <reportpath>
-
countin <number> <type> <amount> <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
-
nocountin <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
-
countout <number> <type> <amount> <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
-
nocountout <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
-
-
-You can set traffic limit per day (D), week (W), month (M), year (Y) or -absolute ('N'), as specified by 'type' argument of counterin command. -Traffic information is stored in binary file specified by 'filename' argument. -countersutil utility can be used to manage this file. -reportpath specifies location of text reports, type parameter of 'counter' -command controls how often text reports are created. amount is amount of -allowed traffic in Megabytes (MB). nocountin allows you to set exclusions. -
-3proxy accounts protocol level traffic. Provider counts channel or IP-level traffic with network and transport headers. In additions, 3proxy doesn't counts DNS resolutions, pings, floods, scans, etc. It makes approx. 10% of difference. That's why you should have 15% reserve if you use 3proxy to limit your traffic. If difference with your provider is significantly above 10% you should look for traffic avoiding proxy server, for example connections through NAT, traffic originated from the host with proxy installed, traffic from server applications, etc. -
- For name resolution and caching use commands nserver, nscache / nscache6 and nsrecord. -
- nserver 192.168.1.2 - nserver 192.168.1.3:5353/tcp- sets DNS resolvers. 192.168.1.3 will be used via TCP/5353 (instead of default UDP/53) - only if 192.168.1.2 fails. Up to 5 nservers may be specified. - If no nserver is configured, default system name resolution functions are used. -
- nscache 65535 - nscache6 65535- sets name cache size for IPv4 and IPv6. Name cache must be large enouth, if presents. - name cache is only used if nserver is configured. -
- nsrecord server.mycompany.example.com 192.168.1.1 - nsrecord www.porno.com 127.0.0.2 - ... - deny * * 127.0.0.2- adds static nsrecords. Also, static nsrecords are used for dnspr, unless -s option is specified. - Since 0.8 version, parent proxy may be configured for dnspr. - -
- IPv6 is supported since 0.8. Please note, some proxy protolos, e.g. SOCKSv4,
- do not support IPv6. SOCKSv5 supports IPv6 with special request type (must be
- implemented by client).
-
- 3proxy supports proxying from IPv4 and IPv6 networks to IPv4,
- IPv6 and mixed networks. IPv6 address may be used in
- internal, external, parent commands, ACLs, -i and -e options,etc.
- external command and -e options may be given twice for each service - once with IPv4
- and once with IPv6 address. internal can be given only once, to bind to all IPv4 and
- IPv6 addresses use [0:0:0:0:0:0:0:0] or [::].
-
- Any service may be configured with -4, -46, -64, -6 options to specify decied
- priority for name to IPv4/IPv6 address resolution (IPv4 only, IPv4 priority,
- IPv6 priority, IPv6 only).
-
- In example, users needs access from external network to proxy server located - on the host 192.168.1.2. This host can not be accessed from external network, - but it has access to external network with with external address 1.1.1.1. - Also, user has access to the host 2.2.2.2 (IP address may be dynamic) with - hostname host.dyndns.example.org via external network. User needs 2 instances - of 3proxy, first one on the host 192.168.1.2 with config -
- users user:CL:password - auth strong - allow user - proxy -rhost.dyndns.example.org:1234- second one on the host.dyndns.example.org (2.2.2.2) with config -
- auth iponly - allow * * 1.1.1.1 - tcppm -R0.0.0.0:1234 3128 1.1.1.1 3128- For browser settings proxy is host.dyndns.example.org:3128. - - - -
-
-
-Latest version of 3proxy may be obtained -here. -New version may have changes and incompatibilities with previous one in files -format or commands. Please, read CHANGELOG file and another documentation -before installing new version. -
--If installed as system service, 3proxy understands Windows service commands -for START, STOP, PAUSE and RESUME. If service is PAUSEd, no new connections -are accepted while older connections are processed. Currently there is no -support for dynamic configuration change, so, you have to restart service -completely if you have changed any configuration. - -You can control 3proxy service via "Services" administration ot via "net" command: -
- net start 3proxy - net stop 3proxy - net pause 3proxy - net continue 3proxy -- -
-
- Ask it in Github. - Don't try to ask something before reading this document. - - - - diff --git a/How-To-(русский).md b/How-To-(русский).md index 5779aef..2e5569d 100644 --- a/How-To-(русский).md +++ b/How-To-(русский).md @@ -219,7 +219,7 @@
Убедитесь, что выправильно понимаете что такое internal и external адреса. Оба адреса - это адреса, принадлежищие хосту, на котором установлен 3proxy. diff --git a/How-To.md b/How-To.md new file mode 100644 index 0000000..8d0c780 --- /dev/null +++ b/How-To.md @@ -0,0 +1,1072 @@ +
+
+Extract source code files from 3proxy.tgz (with WinZip or another utility). +Use nmake /f Makefile.msvc command +
++See How to compile 3proxy with Visual C++ +Use Makefile.intl instead of Makefile.msvc +
++Extract source files from 3proxy.tgz (for example with tar -xzf 3proxy.tgz command if you have tar installed) +Use make -f Makefile.win command. +If you want to use POSIX emulation Cygwin library (normally you shouldn't) - use make -f Makefile.unix instead. +Windows specific things (like installing as service) will not be available if compiled with Cygwin emulation. +
++Use +
+make -f Makefile.Linux ++for Linux or Cygwin, Makefile.Solaris* (depending on compiler version) for Solaris +and Makefile.unix for different Unix-like OSes. On BSD-derived systems, make +sure to use GNU make; sometimes it's called gmake instead of make. +
+
+Unpack 3proxy.zip to any directory, for example +c:\Program Files\3proxy. If needed, create a directory for storing log files, +ODBC sources, etc. Create 3proxy.cfg in the 3proxy installation directory (see Server configuration). +If you use 3proxy before version 0.6, add the +
+service ++string into 3proxy.cfg. Now, start a command prompt (cmd.exe). +Change to the 3proxy installation directory and run 3proxy.exe --install: +
+D:\>C: +C:\>cd C:\Program Files\3proxy +C:\Program Files\3proxy>3proxy.exe --install ++Now, you should have the 3proxy service installed and running. If the service is not +started, remove the "service" string from 3proxy.cfg, run 3proxy.exe manually +and correct all errors. +
+To remove 3proxy, run 3proxy --remove: +
+D:\>C: +C:\>cd C:\Program Files\3proxy +C:\Program Files\3proxy>net stop 3proxy +C:\Program Files\3proxy>3proxy.exe --remove ++Now you can simply remove the 3proxy installation directory. + +
+Unpack 3proxy.zip to any directory, for example +c:\Program Files\3proxy. If needed, create a directory for storing log files, +ODBC sources, etc. Create 3proxy.cfg in the 3proxy installation directory (see Server configuration). +Remove the string +
+service ++from 3proxy.cfg and add +
+daemon ++if you want 3proxy to run in the background. +Create a shortcut for 3proxy.exe and place it in the autostart folder or add +it to the registry with regedit.exe: +
+Compile 3proxy (see Compilation). Copy +executables to any appropriate location (for example, /usr/local/3proxy/sbin +for servers and /usr/local/3proxy/bin for utilities). +Create /usr/local/etc/3proxy.cfg. +(see Server configuration). +You can change the default configuration file location by specifying the configuration file +in the 3proxy command line. +Add 3proxy to the system startup scripts. +
++
A valid configuration file is required. + +
The most probable reasons for non-working limitations: 'auth none' or no auth is used. For any ACL-based feature, one of 'iponly', 'nbname', or 'strong' auth is required. The sequence of commands may be invalid. Commands are executed one-by-one, and 'proxy', 'tcppm', 'socks', or another service commands must follow a valid configuration. An invalid sequence of ACLs. The first matching ACL is used (except for internal redirections, see below). If an ACL contains at least one record, the last record is assumed to be 'deny *'. + +
Possible reasons for 3proxy starting manually but failing to start as a service: +
+3proxy --install full_path_to_configuration_file ++
How to understand internal and external +
+Both internal and external IPs are IPs of the host running 3proxy itself. +This configuration option is useful in situations where 3proxy is running on a +border host with 2 (or more) connections: e.g., LAN and WAN with different IPs +
+ LAN connection +-------------+ Internet connection +LAN <-------------->| 3proxy host |<-------------------> INTERNET + ^+-------------+^ + | | + Internal IP External IP ++If 3proxy is used on a host with a single connection, both internal and +external are usually the same IP. +
+Check that you are using a system DSN. +Check that the SQL request is valid. +The best way to check is to use file or stdout logging, get the SQL request from the log file or console, and execute this request manually. +Under Unix, you may also want to adjust the 'stacksize' parameter. + +
The proxy cannot access a destination directly over IPv6 if the client requests an IPv4 address. +To access an IPv6 destination, either an IPv6 address or a hostname must be used in the request. +The best solution is to enable the option to resolve hostnames via the proxy on the client side. + +
The default stacksize may be insufficient if some non-default plugins + are used (e.g., PAM and ODBC on Linux) or if compiled on some platforms with + invalid system-defined values (a few versions of FreeBSD on amd64). + The problem can be resolved with the 'stacksize' command or '-S' option starting with 3proxy 0.8.4. + + +
+A server configuration example, 3proxy.cfg.sample, is included in every 3proxy distribution. +
++3proxy can log to stdout, a file, an ODBC datasource, or +syslog (Unix/Linux/Cygwin only). To use ODBC under Unix/Linux, you must +compile 3proxy with Unix ODBC libraries; see Compilation. +You can control logging from 3proxy.cfg for all services, or you can control +logging for an individual service. For example, +/usr/local/sbin/socks -l/var/log/socks.log starts a SOCKS proxy with logging to a file. +For the universal proxy (3proxy), log file rotation and archiving are supported. +The log type is defined with the "log" configuration file command or with the +-l switch on individual service invocation. log or -l with no argument is stdout logging. +
+ log filename ++and +
+ -lfilename ++specify a filename for logging. +
+ log @ident ++and +
+ -l@ident ++specify an ident for syslog logging. If the filename within the "log" command contains +'%' characters, it is processed as a format specifier (see "logformat"). E.g., +log c:\3proxy\logs\%y%m%d.log D creates a file like c:\3proxy\logs\060729.log; +the date is generated based on local time. +
+ log &connstring ++ +specifies an ODBC connection string; connstring is in the format +datasource,username,password (the last two are optional if the +datasource does not require or already has authentication information). +Also, you must specify logformat to build the SQL query to insert a record into +the log; see How to set up logging format + +
+Rotation and archiving may be set up with log, rotate, and archiver commands. +
+ log filename LOGTYPE ++sets the rotation type. LOGTYPE may be: +
+ rotate NUMBER ++ specifies the number of files in rotation (i.e., how many files to keep). +
+ archiver EXT COMMAND PARAMETERS ++ Sets an external archiver. EXT is the extension of archived files + (for example, zip, gz, Z, rar, etc.). COMMAND and PARAMETERS are the command + to execute and its command-line parameters. The original file is not deleted by + 3proxy; this work is left for the archiver. + You can pass the original filename to the archiver with the %F macro and the archive filename with %A. + Examples are located in + 3proxy.cfg.sample + +
+ Since version 0.3, the log format may be set with the "logformat" command. + The first symbol of the log format specifies the format of the date and time and + should be L (LOCAL) or G (GMT - Greenwich Meridian Time). The format + string may contain some macro substitutions: +
+logformat "L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T" ++ generates something like +
+1042454727.0296 SOCK4.1080 000 3APA3A 127.0.0.1:4739 195.122.226.28:4739 505 18735 1 GET http://3proxy.org/ HTTP/1.1
+
+
(no line breaks)
+
+ If ODBC is used, logformat should specify the SQL command + to insert a record into the log, for example: +
+logformat "-\'+_GINSERT INTO proxystat VALUES (%t, '%c', '%U', %I)"+
+Just make the format of 3proxy logs compatible with a format supported by your
+favorite log analyzer. Examples of compatible logformats are:
+
+For Squid access.log:
+
+"- +_G%t.%. %D %C TCP_MISS/200 %I %1-1T %2-2T %U DIRECT/%R application/unknown" +
+or, a more compatible format without %D: ++"- +_G%t.%. 1 %C TCP_MISS/200 %I %1-1T %2-2T %U + DIRECT/%R application/unknown" ++ISA 2000 proxy WEBEXTD.LOG (fields are TAB-delimited): +
+"- + L%C %U Unknown Y %Y-%m-%d %H:%M:%S + w3proxy 3PROXY - %n %R %r %D + %O %I http TCP %1-1T %2-2T - - + %E - - -" ++ISA 2004 proxy WEB.w3c (fields are TAB-delimited): +
+"- + L%C %U Unknown %Y-%m-%d %H:%M:%S + 3PROXY - %n %R %r %D %O + %I http %1-1T %2-2T - %E - + - Internal External 0x0 Allowed" ++ISA 2000/2004 firewall FWSEXTD.log (fields are TAB-delimited): +
+"- + L%C %U unnknown:0:0.0 N %Y-%m-%d + %H:%M:%S fwsrv 3PROXY - %n %R %r + %D %O %I %r TCP Connect - - + - %E - - - - -" ++HTTPD standard log (Apache and others): +
+"-""+_L%C - %U [%d/%o/%Y:%H:%M:%S %z] ""%T"" %E %I" +
+or a more compatible format without the error code: ++"-""+_L%C - %U [%d/%o/%Y:%H:%M:%S %z] ""%T"" 200 %I" +
+
+3proxy is distributed in 2 variants: as a set of standalone modules (proxy,
+socks, pop3p, tcppm, udppm) and as a universal proxy server. These services are
+absolutely independent, and if you use 3proxy, you don't need any of the standalone
+modules.
+
Standalone modules are only configurable via the command line interface, while
+3proxy uses a configuration file. Many functions, such as ODBC logging, log
+rotation, access control, etc., are only available in 3proxy, not in standalone
+proxies.
+A standalone module may be started from the command line, for example:
+
+$/sbin/socks -l/var/log/socks.log -i127.0.0.1 ++Starts a SOCKS server bound to localhost IP, port 1080, with logging to +/var/log/socks.log. +You can get help for any standalone service with the -? command line option. +
+If 3proxy is used, you should start all services in the 3proxy.cfg file. 3proxy.cfg +is executed by 3proxy as a batch file. An example of 3proxy.cfg and command syntax +can be found in +3proxy.cfg.sample. +
+log /var/log/3proxy.log D +rotate 30 +internal 127.0.0.1 +external 192.168.1.1 +proxy +socks -p3129 +pop3p ++Starts 3 services: HTTP PROXY, SOCKS, and POP3 PROXY. Each listens on the localhost +interface with the default port (3128 for HTTP, 1080 for SOCKS, and 110 for POP3P) +except socks, which is started with port 3129. +All logs are in the file /var/log/3proxy.log (with daily date modification and +rotation). The 30 most recent files are stored. + +
+The -i option specifies the internal interface; -p specifies the listening port. No spaces are +allowed. To bind the 'proxy' service to port 8080 on interfaces 192.168.1.1 +and 192.168.2.1, use: +
+proxy -p8080 -i192.168.1.1 +proxy -p8080 -i192.168.2.1 ++ +
+ A: Use one of proxy, connect+, socks4+, or socks5+ as the parent type. 3proxy + itself still performs name resolution; it's required, e.g., for ACL matching. + So, if no name resolution must be performed by 3proxy itself, add the command +
+ fakeresolve+ This command resolves any name to the 127.0.0.2 address. + +
+ There is FTP over HTTP (what is called FTP proxy in browsers) and FTP over FTP + (what is called FTP proxy in file managers and FTP clients). For browsers, there is no need to start an additional + proxy service; 'proxy' supports FTP over HTTP. Configure the 'proxy' port as an FTP proxy. For FTP clients and file + managers, use ftppr. The FTP proxy supports both active and passive mode with the client but always uses passive mode with FTP servers. +
++ An SNI proxy can be used to transparently redirect any TLS traffic with an external router or via local redirection rules. It can also be used + to extract hostnames from TLS to use in ACLs in combination with SOCKS or HTTP(s) proxy and/or the Transparent plugin. It can also be used to require TLS or mTLS between services. The TLS handshake contains no + port information; if tlspr is used as a standalone service, the destination port may be either detected with the Transparent plugin or configured with the -P option (default 443). +
+ The -c option is used to specify the level of TLS check: +
+0 (default) - allow non-TLS traffic +1 - require TLS, only check client HELLO packet +2 - require TLS, check both client and server HELLO +3 - require TLS, check that the server sends a certificate (not compatible with TLS 1.3) +4 - require mutual TLS, check that the server sends a certificate request and the client sends a certificate (not compatible with TLS 1.3) ++
+Configuration examples: +1. Port 1443 may be used to redirect traffic to destination port 143. SNI is used to find the destination host. +
+tlspr -p1443 -P443 -c1 ++2. Used as a parent TLS proxy to detect the destination hostname from TLS in socks: +
+allow * * * 80 +parent 1000 http 0.0.0.0 0 +allow * * * * CONNECT +parent 1000 tls 0.0.0.0 0 +deny * * some.not.allowed.host +allow * +socks ++ +
+First, always specify the internal interface to accept incoming connections with the +'internal' configuration command or '-i' service command. (See +How to start any of the proxy services (HTTP, SOCKS, etc.)). If +no internal interface is specified, your proxy will act as an open proxy. +
It's also important to specify the external interface to prevent access to the +internal network with 'external' or -e. +
3proxy with configuration files allows you to use authentication and +authorization for user access. Authentication is possible by +username/password or the user's NetBIOS name. The authentication type is specified by the +'auth' command. +
+auth none ++Disables both authentication and authorization. You cannot use ACLs. +
+auth iponly ++Specifies no authentication; ACL-based authorization is used. +
+auth nbname ++Authentication by NetBIOS name + ACLs. The NetBIOS name of the 'messenger' service +is obtained before ACL validation. If no name is obtained, it's assumed to be +empty. Messenger is started by default in Windows NT/2000/XP. For Win9x, +WinPopUP needs to be launched. This type of authentication may be spoofed +by a privileged local user. +
+auth strong ++Authentication by username/password. If the user is not registered, their +access is denied regardless of ACLs. +
+Different services can have different authentication levels. +
+auth none +pop3p +auth iponly +proxy +auth strong +socks ++ +It's possible to authorize access by client IP address, IP address or requested resource, +target port, time, etc., after authentication. +(See How to limit resource access). +
Since version 0.6, double authentication is possible, e.g.: +
+auth iponly strong +allow * * 192.168.0.0/16 +allow user1,user2 +proxy ++Strong authentication will only be used if the ACL requires a username to decide if +access must be granted. That is, in the example, strong username authentication +is not required to access 192.168.0.0/16. +
Version 0.6 introduces authentication (username) caching to increase +performance. It's recommended to use authentication caching with resource- +or time-consuming authentication types, such as nbname or external plugins +(WindowsAuthentication). +Caching can be set with the 'authcache' command with 2 parameters: caching type +and caching time (in seconds). The caching type defines the type of cached access: +'ip' - after successful authentication, all connections during the caching time +from the same IP are assigned to the same user; the username is not requested. +"ip,user" - the username is requested, and all connections from the same IP are +assigned to the same user without actual authentication. "user" - same as above, +but IP is not checked. "user,password" - username and password are checked +against cached ones. For authentication, the special authentication type 'cache' +must be used. + Example: +
+authcache ip 60 +auth cache strong windows +proxy -n ++ +Please note that caching affects security. Never use caching for access to +critical resources, such as web administration. +
authcache can be used to bind a user's sessions to an IP with the 'limit' option. With +
+ authcache ip,user,pass,limit 120 + auth cache strong+ the user will not be able to use more than a single IP during the cache time (120 sec). + +
+The user list is created with the 'users' command. +
+users USERDESC ... ++With a single command, it's possible to define a few users, or you +can use multiple 'users' commands. USERDESC is a user description. The description +consists of three semicolon-delimited parts - login, password type, and +
+users admin:CL:bigsecret test:CL:password test1:CL:password1 +users "test2:CR:$1$lFDGlder$pLRb4cU2D7GAT58YQvY49." +users test3:NT:BD7DFBF29A93F93C63CB84790DA00E63 ++Please note the usage of quotation marks: they're required to escape the $ sign, +which is otherwise used as a file inclusion macro. +The following password types are available: +
+users $/etc/.3proxypasswd ++or +
+users $"c:\Program Files\3proxy\passwords" ++It's possible to create NT and crypt passwords with the mycrypt utility included +in the distribution. +
+The commands allow, deny, and flush are used to manage ACLs: +
+allow <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist> <weekdaylist> <timeperiodlist>
+
deny <userlist> <sourcelist> <targetlist> <weekdaylist> <timeperiodlist>
+
flush
+
+
+
+Redirections are useful to, e.g., forward requests from specific clients
+to different servers or proxy servers. Additionally, redirections are useful
+to convert the proxy interface from one format to another, e.g., requests from
+a SOCKS proxy can be redirected to a parent HTTP proxy, or a SOCKSv5 client can be
+redirected to a SOCKSv4 proxy.
+
Because 3proxy understands "transparent" web requests, it can be used as an
+intermediate software between an HTTP proxy and a NAT server for transparent HTTP
+forwarding, because it can convert a "Web server" request issued by a client to a
+"proxy request" required by a proxy server. A simple redirection is:
+
+auth iponly +allow * +parent 1000 http 192.168.1.1 3128 +proxy ++All traffic of the HTTP proxy is redirected to the parent proxy 192.168.1.1 port 3128. +
+auth iponly +allow * * * 80 +parent 1000 http 0.0.0.0 0 +allow * * * 21 +parent 1000 ftp 0.0.0.0 0 +allow * * * 110 +parent 1000 pop3 0.0.0.0 0 +socks ++In this case, all SOCKS traffic with destination port 80 is forwarded to the local +'proxy' service, destination port 21 to 'ftppr', and 110 to 'pop3pr'. There is +no need to run these services explicitly. Local redirections are useful if +you want to see and control via ACLs protocol-specific parameters, e.g., +filenames requested through FTP while clients are using SOCKS. + +
+
Q: What is it for?
+A: To have control based on the request and to have URLs and other protocol-specific parameters logged. + +Q: What are the restrictions?
+A: It's hard to redirect services for non-default ports; Internet Explorer supports only SOCKSv4 with no password authentication (Internet Explorer sends the username, but not the password); for SOCKSv5, only cleartext password authentication is supported. + +Q: What are the advantages?
+A: You only need to set up a SOCKS proxy in browser settings. You can use a socksifier, e.g., FreeCAP or SocksCAP, with an application that is not proxy-aware. + +Q: How to set it up?
+A: You should specify a parent proxy with an IP of 0.0.0.0 and port 0. Examples: ++auth iponly +allow * * * 80,8080-8088 +parent 1000 http 0.0.0.0 0 +allow * * * 80,8080-8088 +#redirect ports 80 and 8080-8088 to local HTTP proxy +#Second allow is required, because ACLs are checked +#twice: first time by socks and second by http proxy. + +allow * * * 21,2121 +parent 1000 ftp 0.0.0.0 0 +allow * * * 21,2121 +#redirect ports 21 and 2121 to local +#ftp proxy + + +allow * +#allow the rest of connections directly + +socks +#now let the socks server start ++ +
Q: How does it affect different ACL rules?
+A: After local redirections, rules are applied again to the protocol-level request. The redirection rule itself is skipped. This makes it possible to redirect the request again to an external proxy depending on the request itself. ++allow * * * 80,8080-8088 +parent 1000 http 0.0.0.0 0 +#redirect http traffic to internal proxy + +allow * * $c:\3proxy\local.nets 80,8080-8088 +#allow direct access to local.nets networks +allow * * * 80,8080-8088 +parent 1000 http proxy.3proxy.org 3128 +#use parent caching proxy for the rest of the networks + +allow * +#allow direct connections for the rest of socks +#requests ++ +
+The proxy itself doesn't manage network-level routing. The only way to control +the outgoing channel is to select the external interface. It's possible to make +the external interface (what is usually selected with the 'external' command or +'-e' option) random by using local redirection with an external port of 0. +
+auth iponly +allow * +parent 500 http 10.1.1.101 0 +parent 500 http 10.2.1.102 0 ++Now the external interface is randomly selected with 0.5 probability between +10.1.1.101 and 10.2.1.102. To work as expected, different default routes +must be used between the 2 interfaces. +
+If both interface addresses are in the same network, e.g., 10.1.1.101 and 10.1.1.102, +and you want to select a random gateway between 10.1.1.1 and 10.1.1.2, you must +control it by using the routing table, in case there is no default gateway route +for Windows: +
+ route add -p 10.1.1.1 10.1.1.101 + route add -p 10.1.1.2 10.1.1.102 + route add -p 0.0.0.0 mask 0.0.0.0 192.168.1.1 + route add -p 0.0.0.0 mask 0.0.0.0 192.168.1.2 ++If you don't have a second address yet, just add it. Under Linux/Unix, it's better +to use source routing. + +
+The parent command may also be used to build proxy chains. In this case, +multiple 'parent' commands are used for a single 'allow' rule with different +weights (the first argument of the parent command). A chain may contain any number +of proxy servers, but it should be noted that every hop significantly +reduces performance. It's possible to mix different types of proxies within a +single chain: HTTPS (HTTP connect), SOCKS4, SOCKS5. A weight different from +1000 is used to build random chains. If weight W is below 1000, this proxy +will be used as the next chain hop with a probability of W/1000. That is, if +the weight is 250, the probability that this proxy will be used for the next hop is +25%. 'parent' records with a combined weight of 1000 establish a group; one of +these records will be used for the hop with a probability according to the weight. +Warning: each group must have a weight that is a multiple of 1000. As follows, the combined +weight of all 'parent' records must also be a multiple of 1000. If the combined weight +of 'parent' records in the chain is 3000, the chain has 3 hops and must be formed +of 3 groups. Example: +
+allow * +parent 500 socks5 192.168.1.1 1080 +parent 500 connect 192.168.10.1 3128 ++In this case, we have 1 parent proxy (1 hop) which is randomly chosen between +2 hosts: 192.168.1.1 and 192.168.10.1. The 2 records form a single group. +
+allow * * * 80 +parent 1000 socks5 192.168.10.1 1080 +parent 1000 connect 192.168.20.1 3128 +parent 300 socks4 192.168.30.1 1080 +parent 700 socks5 192.168.40.1 1080 ++In this case, we have 3 groups (3 hops in the chain). The first hop is 192.168.10.1, +the second hop is 192.168.20.1, and the 3rd one is either 192.168.30.1 with a probability +of 30% or 192.168.40.1 with a probability of 70%. + + +
+3proxy supports bandwidth filters. Use the bandlimin/bandlimout and +nobandlimin/nobandlimout commands to manage filters. 'in' means incoming and 'out' means outgoing traffic. +
+bandlimin <bitrate> <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
+
nobandlimin <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
+
+
+ bandlimin 57600 * 192.168.10.16 + bandlimin 57600 * 192.168.10.17 + bandlimin 57600 * 192.168.10.18 + bandlimin 57600 * 192.168.10.19 ++Create 4 separate pipes for 4 clients with emulation of a modem connection. +
+ bandlimin 57600 * 192.168.10.16/30 ++Create a single pipe for all 4 clients. That is, 4 clients share a modem connection. +In this example: +
+ nobandlimin * * * 110 + bandlimin 57600 * 192.168.10.16/32 ++mail traffic from POP3 servers bypasses the pipe and has no bandwidth +limitation. + +
+
+counter <filename> <type> <reportpath>
+
countin <number> <type> <amount> <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
+
nocountin <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
+
countout <number> <type> <amount> <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
+
nocountout <userlist> <sourcelist> <targetlist> <targetportlist> <commandlist>
+
+
+You can set a traffic limit per day (D), week (W), month (M), year (Y), or +absolute ('N'), as specified by the 'type' argument of the counterin command. +Traffic information is stored in a binary file specified by the 'filename' argument. +The countersutil utility can be used to manage this file. +The reportpath specifies the location of text reports; the type parameter of the 'counter' +command controls how often text reports are created. The amount is the amount of +allowed traffic in megabytes (MB). nocountin allows you to set exclusions. +
+3proxy accounts for protocol-level traffic. Providers count channel- or IP-level traffic with network and transport headers. In addition, 3proxy does not count DNS resolutions, pings, floods, scans, etc. This accounts for approximately a 10% difference. That is why you should have a 15% reserve if you use 3proxy to limit your traffic. If the difference with your provider is significantly above 10%, you should look for traffic bypassing the proxy server, for example connections through NAT, traffic originating from the host with the proxy installed, traffic from server applications, etc. +
+ For name resolution and caching, use the commands nserver, nscache / nscache6, and nsrecord. +
+ nserver 192.168.1.2 + nserver 192.168.1.3:5353/tcp+ sets DNS resolvers. 192.168.1.3 will be used via TCP/5353 (instead of default UDP/53) + only if 192.168.1.2 fails. Up to 5 nservers may be specified. + If no nserver is configured, default system name resolution functions are used. +
+ nscache 65535 + nscache6 65535+ sets name cache size for IPv4 and IPv6. The name cache must be large enough, if present. + The name cache is only used if nserver is configured. +
+ nsrecord server.mycompany.example.com 192.168.1.1 + nsrecord www.porno.com 127.0.0.2 + ... + deny * * 127.0.0.2+ adds static nsrecords. Also, static nsrecords are used for dnspr, unless the -s option is specified. + Since version 0.8, a parent proxy may be configured for dnspr. + +
+ IPv6 is supported since version 0.8. Please note that some proxy protocols, e.g., SOCKSv4,
+ do not support IPv6. SOCKSv5 supports IPv6 with a special request type (which must be
+ implemented by the client).
+
+ 3proxy supports proxying from IPv4 and IPv6 networks to IPv4,
+ IPv6, and mixed networks. An IPv6 address may be used in
+ internal, external, and parent commands, ACLs, -i and -e options, etc.
+ The external command and -e options may be given twice for each service—once with an IPv4
+ and once with an IPv6 address. internal can be given only once; to bind to all IPv4 and
+ IPv6 addresses, use [0:0:0:0:0:0:0:0] or [::].
+
+ Any service may be configured with -4, -46, -64, or -6 options to specify the desired
+ priority for name-to-IPv4/IPv6 address resolution (IPv4 only, IPv4 priority,
+ IPv6 priority, IPv6 only).
+
+ For example, a user needs access from an external network to a proxy server located + on the host 192.168.1.2. This host cannot be accessed from the external network, + but it has access to the external network with an external address 1.1.1.1. + Also, the user has access to the host 2.2.2.2 (IP address may be dynamic) with + hostname host.dyndns.example.org via the external network. The user needs 2 instances + of 3proxy, the first one on the host 192.168.1.2 with the config +
+ users user:CL:password + auth strong + allow user + proxy -rhost.dyndns.example.org:1234+ and the second one on host.dyndns.example.org (2.2.2.2) with the config +
+ auth iponly + allow * * 1.1.1.1 + tcppm -R0.0.0.0:1234 3128 1.1.1.1 3128+ For browser settings, the proxy is host.dyndns.example.org:3128. + + + +
+
+
+The latest version of 3proxy may be obtained +here. +A new version may have changes and incompatibilities with the previous one in file +formats or commands. Please read the CHANGELOG file and other documentation +before installing a new version. +
++If installed as a system service, 3proxy understands Windows service commands +for START, STOP, PAUSE, and RESUME. If the service is PAUSEd, no new connections +are accepted while older connections are processed. Currently, there is no +support for dynamic configuration changes, so you have to restart the service +completely if you have changed any configuration. + +You can control the 3proxy service via "Services" administration or via the "net" command: +
+ net start 3proxy + net stop 3proxy + net pause 3proxy + net continue 3proxy ++ +
+
+ Ask it in Github. + Please read this document before asking a question. + + + + diff --git a/PCREPlugin-(русский).md b/PCREPlugin-(русский).md index ea59bcc..ed83631 100644 --- a/PCREPlugin-(русский).md +++ b/PCREPlugin-(русский).md @@ -56,7 +56,7 @@ PCRE_BSR_UNICODE
@@ -12,11 +12,11 @@ pcre_rewrite TYPE FILTER_ACTION REGEXP REWRITE_EXPRESSION [ACE] pcre_extend FILTER_ACTION [ACE] pcre_options OPTION1 [...]-pcre - allows to apply some rule for matching -
plugin /path/to/SslPlugin.dll ssl_plugin ssl_server_ca_file /path/to/cafile @@ -47,7 +47,7 @@ proxy -p3128 ssl_nomitm proxy -p3129-mitm's traffic with spoofed ceritifacate for port 3128 proxy. +MITM's traffic with a spoofed certificate for the port 3128 proxy.
@@ -59,6 +59,6 @@ proxy -p33128 ssl_noserv proxy -p3128-creates https:// proxy on 33128 and http:// proxy on 3128 +Creates an https:// proxy on port 33128 and an http:// proxy on port 3128 © Vladimir Dubrovin, License: BSD style diff --git a/Security-recommendations.md b/Security-recommendations.md index 860f411..da334ac 100644 --- a/Security-recommendations.md +++ b/Security-recommendations.md @@ -1,35 +1,33 @@ -
diff --git a/StringsPlugin-(русский).md b/StringsPlugin-(русский).md index 97ebbdf..4d9e1a9 100644 --- a/StringsPlugin-(русский).md +++ b/StringsPlugin-(русский).md @@ -15,4 +15,4 @@ plugin "StringsPlugin.dll" start c:\3proxy\bin\rus-win1251.3ps
plugin "StringsPlugin.dll" start c:\3proxy\bin\rus.3ps -- -
plugin "StringsPlugin.dll" start c:\3proxy\bin\rus.3ps ++ +
@@ -66,4 +66,4 @@ trafcorrect m socks5 6112 4.5Загрузить:
-This plugin attempts to correct 3proxy computations to approximate network or -link level traffic by using either fixed coefficients by port number or -attempting to predict number and sizes of network packets. +This plugin attempts to correct 3proxy's computations to approximate network or +link-level traffic by using either fixed coefficients by port number or +by attempting to predict the number and sizes of network packets.
plugin TrafficPlugin.dll start
trafcorrect m <service> <target port> <coefficient>-where <service> - one of proxy, socks4, socks45, socks5, tcppm, udppm, pop3p, * matches "any". -
trafcorrect p <service> <tcp/udp> <target port> [empty packet size]-tcp ot udp - transport level protocol to apply rule +tcp or udp - transport-level protocol to apply the rule to
plugin "TrafficPlugin.dll" start trafcorrect m socks5 6112 4.5 trafcorrect m socks5 * 1.1-wrong usage: +Wrong usage:
trafcorrect m socks5 * 1.1 trafcorrect m socks5 6112 4.5-second rule will never be applied. +The second rule will never be applied.
plugin /path/to/TransparentPlugin.ld.so transparent_plugin @@ -19,13 +19,13 @@ notransparent proxyNow, any TCP traffic transparently redirected to port 12345 will be routed via -parent SOCKSv5 proxy and logged, all URLs for web requests are visible in logs. -Paremeters '127.0.0.1 11111' in this case are not used and are overwritten by -destination IP:port for each transparent connection. +the parent SOCKSv5 proxy and logged; all URLs for web requests are visible in logs. +The parameters '127.0.0.1 11111' in this case are not used and are overwritten by +the destination IP:port for each transparent connection.
plugin "WindowsAuthentication.dll" WindowsAuthentication "3ProxyAllowedGroup"
-authcache user,pass 900 auth cache windows-
ftppr - +
ftppr - FTP proxy gateway service
ftppr +
ftppr [-d] [-l[[@]logfile]] [-pport] [-iinternal_ip] [-eexternal_ip] @@ -43,7 +43,7 @@ FTP proxy gateway service
-ftppr is +
ftppr is FTP gateway service to allow internal users to access external FTP servers.
@@ -55,128 +55,131 @@ external FTP servers.| + |
-I |
-- | + | + |
Inetd mode. Standalone service only. | |
| + |
- -d |
-- |
+ -d |
++ |
- Daemonise. Detach service from console and run in the -background. | |
| + |
- -t |
-- |
+ -t |
++ |
- Be silenT. Do not log start/stop/accept error -records. | |
| + |
- -u |
-- |
+ -u |
++ |
- Never look for username authentication. | |
| + |
- -e |
-- |
+ -e |
++ |
- External address. IP address of interface proxy should -initiate connections from. By default system will deside -which address to use in accordance with routing table. | |
| + |
- -i |
-- |
+ -i |
++ |
- Internal address. IP address proxy accepts connections -to. By default connection to any interface is accepted. -It´s usually unsafe. | |
| + |
- -h |
-- |
+ -h |
++ |
- Default destination. It’s used if targed address -is not specified by user. | |
| + |
- -p |
-- |
+ -p |
++ |
- Port. Port proxy listens for incoming connections. -Default is 21. | |
| + |
- -l |
-- |
+ -l |
++ |
- Log. By default logging is to stdout. If logfile -is specified logging is to file. Under Unix, if -´@´ preceeds logfile, syslog is -used for logging. | |
| + |
- -S |
-- |
+ -S |
++ |
- Increase or decrease stack size. You may want to try -something like -S8192 if you experience 3proxy crashes. |
You can use any -FTP client, regardless of FTP proxy support. For client with -FTP proxy support configure internal_ip and -port in FTP proxy parameters. For clients without FTP -proxy support use internal_ip and port as FTP -server. Address of real FTP server must be configured as a -part of FTP username. Format for username is -username@server, where server is -address of FTP server and username is user´s -login on this FTP server. Login itself may contain -´@´ sign. Only cleartext authentication is -currently supported.
+You can use any +FTP client, regardless of FTP proxy support. For a client +with FTP proxy support, configure internal_ip and +port in the FTP proxy parameters. For clients without +FTP proxy support, use internal_ip and port as +the FTP server. The address of the real FTP server must be +configured as a part of the FTP username. The format for the +username is username@server, where +server is the address of the FTP server and +username is the user´s login on this FTP +server. The login itself may contain an ´@´ +sign. Only cleartext authentication is currently +supported.
Report all bugs +
Report all bugs to 3proxy@3proxy.org
3proxy(8), +
3proxy(8),
proxy(8), pop3p(8), socks(8), tcppm(8), udppm(8),
syslogd(8),
https://3proxy.org/
3proxy is +
3proxy is designed by Vladimir 3APA3A Dubrovin (3proxy@3proxy.org)
pop3p - +
pop3p - POP3 proxy gateway service
pop3p +
pop3p [-d] [-l[[@]logfile]] [-pport] [-iinternal_ip] [-eexternal_ip] @@ -43,7 +43,7 @@ POP3 proxy gateway service
-pop3p is +
pop3p is POP3 gateway service to allow internal users to access external POP3 servers.
@@ -55,128 +55,131 @@ external POP3 servers.| + |
-I |
-- | + | + |
Inetd mode. Standalone service only. | |
| + |
- -d |
-- |
+ -d |
++ |
- Daemonise. Detach service from console and run in the -background. | |
| + |
- -t |
-- |
+ -t |
++ |
- Be silenT. Do not log start/stop/accept error -records. | |
| + |
- -u |
-- |
+ -u |
++ |
- Never look for username authentication. | |
| + |
- -e |
-- |
+ -e |
++ |
- External address. IP address of interface proxy should -initiate connections from. By default system will deside -which address to use in accordance with routing table. | |
| + |
- -i |
-- |
+ -i |
++ |
- Internal address. IP address proxy accepts connections -to. By default connection to any interface is accepted. -It´s usually unsafe. | |
| + |
- -p |
-- |
+ -p |
++ |
- Port. Port proxy listens for incoming connections. -Default is 110. | |
| + |
- -h |
-- |
+ -h |
++ |
- Default destination. It’s used if targed address -is not specified by user. | |
| + |
- -l |
-- |
+ -l |
++ |
- Log. By default logging is to stdout. If logfile -is specified logging is to file. Under Unix, if -´@´ preceeds logfile, syslog is -used for logging. | |
| + |
- -S |
-- |
+ -S |
++ |
- Increase or decrease stack size. You may want to try -something like -S8192 if you experience 3proxy crashes. |
You can use any -MUA (Mail User Agent) with POP3 support. Set client to use -internal_ip and port as a POP3 server. Address -of real POP3 server must be configured as a part of POP3 -username. Format for username is +
You can use any +MUA (Mail User Agent) with POP3 support. Set the client to +use internal_ip and port as a POP3 server. The +address of the real POP3 server must be configured as a part +of the POP3 username. The format for the username is username@server, where server is -address of POP3 server and username is user´s -login on this POP3 server. Login itself may contain -´@´ sign. Only cleartext authentication is -supported, because challenge-response authentication (APOP, -CRAM-MD5, etc) requires challenge from server before we know -which server to connect.
+the address of the POP3 server and username is the +user´s login on this POP3 server. The login itself may +contain an ´@´ sign. Only cleartext +authentication is supported, because challenge-response +authentication (APOP, CRAM-MD5, etc.) requires a challenge +from the server before we know which server to connect +to.Report all bugs +
Report all bugs to 3proxy@3proxy.org
3proxy(8), +
3proxy(8),
ftppr(8), proxy(8), socks(8), tcppm(8), udppm(8),
syslogd(8),
https://3proxy.org/
3proxy is +
3proxy is designed by Vladimir 3APA3A Dubrovin (3proxy@3proxy.org)
proxy - +
proxy - HTTP proxy gateway service
proxy +
proxy [-d][-a] [-l[[@]logfile]] [-pport] [-iinternal_ip] [-eexternal_ip]
@@ -42,7 +42,7 @@ HTTP proxy gateway service -proxy is +
proxy is HTTP gateway service with HTTPS and FTP over HTTPS support.
@@ -54,138 +54,143 @@ support.| + |
-I |
-- | + | + |
Inetd mode. Standalone service only. | |
| + |
- -d |
-- |
+ -d |
++ |
- Daemonise. Detach service from console and run in the -background. | |
| + |
- -t |
-- |
+ -t |
++ |
- Be silenT. Do not log start/stop/accept error -records. | |
| + |
- -u |
-- |
+ -u |
++ |
- Never ask for username authentication | |
| + |
- -e |
-- |
+ -e |
++ |
- External address. IP address of interface proxy should -initiate connections from. By default system will deside -which address to use in accordance with routing table. | |
| + |
- -i |
-- |
+ -i |
++ |
- Internal address. IP address proxy accepts connections -to. By default connection to any interface is accepted. -It´s usually unsafe. | |
| + |
- -a |
-- |
+ -a |
++ |
- Anonymous. Hide information about client. | |
| + |
- -a1 |
-- |
+ -a1 |
++ |
- Anonymous. Show fake information about client. | |
| + |
- -p |
-- |
+ -p |
++ |
- Port. Port proxy listens for incoming connections. -Default is 3128. | |
| + |
- -l |
-- |
+ -l |
++ |
- Log. By default logging is to stdout. If logfile -is specified logging is to file. Under Unix, if -´@´ preceeds logfile, syslog is -used for logging. | |
| + |
- -S |
-- |
+ -S |
++ |
- Increase or decrease stack size. You may want to try -something like -S8192 if you experience 3proxy crashes. |
You should use -client with HTTP proxy support or configure router to -redirect HTTP traffic to proxy (transparent proxy). -Configure client to connect to internal_ip and -port. HTTPS support allows to use almost any TCP -based protocol. If you need to limit clients, use +
You should use a +client with HTTP proxy support or configure a router to +redirect HTTP traffic to the proxy (transparent proxy). +Configure the client to connect to internal_ip and +port. HTTPS support allows you to use almost any +TCP-based protocol. If you need to limit clients, use 3proxy(8) instead.
Report all bugs +
Report all bugs to 3proxy@3proxy.org
3proxy(8), +
3proxy(8),
ftppr(8), socks(8), pop3p(8), tcppm(8), udppm(8),
syslogd(8),
https://3proxy.org/
3proxy is +
3proxy is designed by Vladimir 3APA3A Dubrovin (3proxy@3proxy.org)
smtpp - +
smtpp - SMTP proxy gateway service
smtpp +
smtpp [-d] [-l[[@]logfile]] [-pport] [-iinternal_ip] [-eexternal_ip] @@ -43,7 +43,7 @@ SMTP proxy gateway service
-smtpp is +
smtpp is SMTP gateway service to allow internal users to access external SMTP servers.
@@ -55,128 +55,131 @@ external SMTP servers.| + |
-I |
-- | + | + |
Inetd mode. Standalone service only. | |
| + |
- -d |
-- |
+ -d |
++ |
- Daemonise. Detach service from console and run in the -background. | |
| + |
- -t |
-- |
+ -t |
++ |
- Be silenT. Do not log start/stop/accept error -records. | |
| + |
- -u |
-- |
+ -u |
++ |
- Never look for username authentication. | |
| + |
- -e |
-- |
+ -e |
++ |
- External address. IP address of interface proxy should -initiate connections from. By default system will deside -which address to use in accordance with routing table. | |
| + |
- -i |
-- |
+ -i |
++ |
- Internal address. IP address proxy accepts connections -to. By default connection to any interface is accepted. -It´s usually unsafe. | |
| + |
- -p |
-- |
+ -p |
++ |
- Port. Port proxy listens for incoming connections. -Default is 25. | |
| + |
- -h |
-- |
+ -h |
++ |
- Default destination. It’s used if targed address -is not specified by user. | |
| + |
- -l |
-- |
+ -l |
++ |
- Log. By default logging is to stdout. If logfile -is specified logging is to file. Under Unix, if -´@´ preceeds logfile, syslog is -used for logging. | |
| + |
- -S |
-- |
+ -S |
++ |
- Increase or decrease stack size. You may want to try -something like -S8192 if you experience 3proxy crashes. |
You can use any +
You can use any MUA (Mail User Agent) with SMTP authentication support. Set -client to use internal_ip and port as a SMTP -server. Address of real SMTP server must be configured as a -part of SMTP username. Format for username is -username@server, where server is -address of SMTP server and username is user´s -login on this SMTP server. Login itself may contain -´@´ sign. Only cleartext authentication is -supported, because challenge-response authentication -(CRAM-MD5, SPA, etc) requires challenge from server before -we know which server to connect.
+the client to use internal_ip and port as an +SMTP server. The address of the real SMTP server must be +configured as a part of the SMTP username. The format for +the username is username@server, where +server is the address of the SMTP server and +username is the user´s login on this SMTP +server. The login itself may contain an ´@´ +sign. Only cleartext authentication is supported, because +challenge-response authentication (CRAM-MD5, SPA, etc.) +requires a challenge from the server before we know which +server to connect to.Report all bugs +
Report all bugs to 3proxy@3proxy.org
3proxy(8), +
3proxy(8),
ftppr(8), proxy(8), socks(8), tcppm(8), udppm(8),
syslogd(8),
https://3proxy.org/
3proxy is +
3proxy is designed by Vladimir 3APA3A Dubrovin (3proxy@3proxy.org)
tlspr - +
tlspr - SNI proxy gateway service
tlspr +
tlspr [-d][-a] [-l[[@]logfile]] [-plistening_port] [-Pdestination_port] @@ -45,10 +45,11 @@ SNI proxy gateway service
-proxy is -SNI gateway service (destination host is taken from TLS -handshake). Destination port must be specified via -P option -(or it may be detected with Transparent plugin).
+tlspr is +an SNI gateway service (destination host is taken from TLS +handshake). The destination port must be specified via the +-P option (or it may be detected with the Transparent +plugin).
| + |
-I |
-- | + | + |
Inetd mode. Standalone service only. | |
| + |
- -d |
-- |
+ -d |
++ |
- Daemonise. Detach service from console and run in the -background. | |
| + |
- -t |
-- |
+ -t |
++ |
- Be silenT. Do not log start/stop/accept error -records. | |
| + |
- -u |
-- |
+ -u |
++ |
- Never ask for username authentication | |
| + |
- -e |
-- |
+ -e |
++ |
- External address. IP address of interface proxy should -initiate connections from. By default system will deside -which address to use in accordance with routing table. | |
| + |
- -i |
-- |
+ -i |
++ |
- Internal address. IP address proxy accepts connections -to. By default connection to any interface is accepted. -It´s usually unsafe. | |
| + |
- -a |
-- |
+ -a |
++ |
- Anonymous. Hide information about client. | |
| + |
- -a1 |
-- |
+ -a1 |
++ |
- Anonymous. Show fake information about client. | |
| + |
- -p |
-- |
+ -p |
++ |
- listening_port. Port proxy listens for incoming -connections. Default is 1443. | |
| + |
- -P |
-- |
+ -P |
++ |
- destination_port. Port to establish outgoing -connections. One is required unless Transparent plugin is -not used because TLS handshake does not contain port -information. Default is 443. | |
| + |
- -c |
-- |
+ -c |
++ |
- TLS_CHECK_LEVEL. 0 (default) - allow non-TLS traffic to -pass, 1 - require TLS, only check client HELLO packet, 2 - -require TLS, check both client and server HELLO, 3 - require -TLS, check server send certificate (not compatible with TLS -1.3), 4 - require mutual TLS, check server send certificate -request and client sends certificate (not compatible with -TLS 1.3) | |
| + |
- -l |
-- |
+ -l |
++ |
- Log. By default logging is to stdout. If logfile -is specified logging is to file. Under Unix, if -´@´ preceeds logfile, syslog is -used for logging. | |
| + |
- -S |
-- |
+ -S |
++ |
- Increase or decrease stack size. You may want to try -something like -S8192 if you experience 3proxy crashes. |
You should use -client with HTTP proxy support or configure router to -redirect HTTP traffic to proxy (transparent proxy). -Configure client to connect to internal_ip and -port. HTTPS support allows to use almost any TCP -based protocol. If you need to limit clients, use -3proxy(8) instead.
+You should use a +client with TLS support or configure a router to redirect +TLS traffic to the proxy (transparent proxy). Configure the +client to connect to internal_ip and port. If +you need to limit clients, use 3proxy(8) instead.
Report all bugs +
Report all bugs to 3proxy@3proxy.org
3proxy(8), +
3proxy(8),
ftppr(8), proxy(8), socks(8), pop3p(8), smtpp(8), tcppm(8),
udppm(8), syslogd(8),
https://3proxy.org/
3proxy is +
3proxy is designed by Vladimir 3APA3A Dubrovin (3proxy@3proxy.org)
tcppm - +
tcppm - TCP port mapper
tcppm +
tcppm [-d] [-l[[@]logfile]] [-iinternal_ip] [-eexternal_ip] local_port remote_host remote_port
@@ -44,7 +44,7 @@ TCP port mapper -tcppm +
tcppm forwards connections from local to remote TCP port
| + |
-I |
-- | + | + |
Inetd mode. Standalone service only. | |
| + |
- -d |
-- |
+ -d |
++ |
- Daemonise. Detach service from console and run in the -background. | |
| + |
- -t |
-- |
+ -t |
++ |
- Be silenT. Do not log start/stop/accept error -records. | |
| + |
- -e |
-- |
+ -e |
++ |
- External address. IP address of interface proxy should -initiate connections from. By default system will deside -which address to use in accordance with routing table. | |
| + |
- -i |
-- |
+ -i |
++ |
- Internal address. IP address proxy accepts connections -to. By default connection to any interface is accepted. -It´s usually unsafe. | |
| + |
- -l |
-- |
+ -l |
++ |
- Log. By default logging is to stdout. If logfile -is specified logging is to file. Under Unix, if -´@´ preceeds logfile, syslog is -used for logging. | |
| + |
- -S |
-- |
+ -S |
++ |
- Increase or decrease stack size. You may want to try -something like -S8192 if you experience 3proxy crashes. |
local_port
+local_port
-- port tcppm accepts -connection
+- port tcppm accepts +connections on
-remote_host
+remote_host
-- IP address of the host +
- IP address of the host the connection is forwarded to
-remote_port
+remote_port
-- remote port connection is +
- remote port the connection is forwarded to
Any TCP based +
Any TCP-based application can be used as a client. Use internal_ip -and local_port as a destination in client -application. Connection is forwarded to +and local_port as the destination in the client +application. The connection is forwarded to remote_host:remote_port
Report all bugs +
Report all bugs to 3proxy@3proxy.org
3proxy(8), +
3proxy(8),
proxy(8), ftppr(8), socks(8), pop3p(8), udppm(8),
syslogd(8),
https://3proxy.org/
3proxy is +
3proxy is designed by Vladimir 3APA3A Dubrovin (3proxy@3proxy.org)
tlspr - +
tlspr - SNI proxy gateway service
tlspr +
tlspr [-d][-a] [-l[[@]logfile]] [-plistening_port] [-Pdestination_port] @@ -45,10 +45,11 @@ SNI proxy gateway service
-proxy is -SNI gateway service (destination host is taken from TLS -handshake). Destination port must be specified via -P option -(or it may be detected with Transparent plugin).
+tlspr is +an SNI gateway service (destination host is taken from TLS +handshake). The destination port must be specified via the +-P option (or it may be detected with the Transparent +plugin).
| + |
-I |
-- | + | + |
Inetd mode. Standalone service only. | |
| + |
- -d |
-- |
+ -d |
++ |
- Daemonise. Detach service from console and run in the -background. | |
| + |
- -t |
-- |
+ -t |
++ |
- Be silenT. Do not log start/stop/accept error -records. | |
| + |
- -u |
-- |
+ -u |
++ |
- Never ask for username authentication | |
| + |
- -e |
-- |
+ -e |
++ |
- External address. IP address of interface proxy should -initiate connections from. By default system will deside -which address to use in accordance with routing table. | |
| + |
- -i |
-- |
+ -i |
++ |
- Internal address. IP address proxy accepts connections -to. By default connection to any interface is accepted. -It´s usually unsafe. | |
| + |
- -a |
-- |
+ -a |
++ |
- Anonymous. Hide information about client. | |
| + |
- -a1 |
-- |
+ -a1 |
++ |
- Anonymous. Show fake information about client. | |
| + |
- -p |
-- |
+ -p |
++ |
- listening_port. Port proxy listens for incoming -connections. Default is 1443. | |
| + |
- -P |
-- |
+ -P |
++ |
- destination_port. Port to establish outgoing -connections. One is required unless Transparent plugin is -not used because TLS handshake does not contain port -information. Default is 443. | |
| + |
- -c |
-- |
+ -c |
++ |
- TLS_CHECK_LEVEL. 0 (default) - allow non-TLS traffic to -pass, 1 - require TLS, only check client HELLO packet, 2 - -require TLS, check both client and server HELLO, 3 - require -TLS, check server send certificate (not compatible with TLS -1.3), 4 - require mutual TLS, check server send certificate -request and client sends certificate (not compatible with -TLS 1.3) | |
| + |
- -l |
-- |
+ -l |
++ |
- Log. By default logging is to stdout. If logfile -is specified logging is to file. Under Unix, if -´@´ preceeds logfile, syslog is -used for logging. | |
| + |
- -S |
-- |
+ -S |
++ |
- Increase or decrease stack size. You may want to try -something like -S8192 if you experience 3proxy crashes. |
You should use -client with HTTP proxy support or configure router to -redirect HTTP traffic to proxy (transparent proxy). -Configure client to connect to internal_ip and -port. HTTPS support allows to use almost any TCP -based protocol. If you need to limit clients, use -3proxy(8) instead.
+You should use a +client with TLS support or configure a router to redirect +TLS traffic to the proxy (transparent proxy). Configure the +client to connect to internal_ip and port. If +you need to limit clients, use 3proxy(8) instead.
Report all bugs +
Report all bugs to 3proxy@3proxy.org
3proxy(8), +
3proxy(8),
ftppr(8), proxy(8), socks(8), pop3p(8), smtpp(8), tcppm(8),
udppm(8), syslogd(8),
https://3proxy.org/
3proxy is +
3proxy is designed by Vladimir 3APA3A Dubrovin (3proxy@3proxy.org)
udppm - +
udppm - UDP port mapper
pop3p +
udppm [-ds] [-l[[@]logfile]] [-iinternal_ip] [-eexternal_ip] local_port remote_host remote_port
@@ -44,7 +44,7 @@ UDP port mapper -udppm +
udppm forwards datagrams from local to remote UDP port
| + |
-I |
-- | + | + |
Inetd mode. Standalone service only. | |
| + |
- -d |
-- |
+ -d |
++ |
- Daemonise. Detach service from console and run in the -background. | |
| + |
- -t |
-- |
+ -t |
++ |
- Be silenT. Do not log start/stop/accept error -records. | |
| + |
- -e |
-- |
+ -e |
++ |
- External address. IP address of interface proxy should -initiate datagrams from. By default system will deside which -address to use in accordance with routing table. | |
| + |
- -i |
-- |
+ -i |
++ |
- Internal address. IP address proxy accepts datagrams to. -By default connection to any interface is accepted. -It´s usually unsafe. | |
| + |
- -l |
-- |
+ -l |
++ |
- Log. By default logging is to stdout. If logfile -is specified logging is to file. Under Unix, if -´@´ preceeds logfile, syslog is -used for logging. | |
| + |
- -s |
-- |
+ -s |
++ |
- Single packet. By default only one client can use udppm -service, but if -s is specified only one packet will be -forwarded between client and server. It allows to share -service between multiple clients for single packet services -(for example name lookups). | |
| + |
- -S |
-- |
+ -S |
++ |
- Increase or decrease stack size. You may want to try -something like -S8192 if you experience 3proxy crashes. |
local_port
+local_port
-- port udppm accepts -datagrams
+- port udppm accepts datagrams +on
-remote_host
+remote_host
-- IP address of the host +
- IP address of the host datagrams are forwarded to
-remote_port
+remote_port
-- remote port datagrams are +
- remote port datagrams are forwarded to
Any UDP based +
Any UDP-based application can be used as a client. Use internal_ip -and local_port as a destination in client +and local_port as the destination in the client application. All datagrams are forwarded to remote_host:remote_port
@@ -196,7 +199,7 @@ application. All datagrams are forwarded to -Report all bugs +
Report all bugs to 3proxy@3proxy.org
3proxy(8), +
3proxy(8),
proxy(8), ftppr(8), socks(8), pop3p(8), udppm(8),
syslogd(8),
https://3proxy.org/
3proxy is +
3proxy is designed by Vladimir 3APA3A Dubrovin (3proxy@3proxy.org)