3proxy.cfg.3 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. .TH 3proxy.cfg "8" "January 2019" "3proxy 0.9" "Universal proxy server"
  2. .SH NAME
  3. .B 3proxy.cfg
  4. 3proxy configuration file
  5. .SH DESCRIPTION
  6. Common structure:
  7. .br
  8. Configuration file is a text file 3proxy reads configuration from. Each line
  9. of the file is a command executed immediately, as it was given from
  10. console. Sequence of commands is important. Configuration file as actually a
  11. script for 3proxy executable.
  12. Each line of the file is treated as a blank (space or tab) separated
  13. command line. Additional space characters are ignored.
  14. Think about 3proxy as "application level router" with console interface.
  15. .br
  16. Comments:
  17. .br
  18. Any string beginning with space character or \'#\' character is comment. It\'s
  19. ignored. <LF>s are ignored. <CR> is end of command.
  20. .br
  21. Quotation:
  22. .br
  23. Quotation character is " (double quote). Quotation must be used to quote
  24. spaces or another special characters. To use quotation character inside
  25. quotation character must be dubbed (BASIC convention). For example to use
  26. HELLO "WORLD" as an argument you should use it as "HELLO ""WORLD""".
  27. Good practice is to quote any argument you use.
  28. .br
  29. File inclusion:
  30. .br
  31. You can include file by using $FILENAME macro (replace FILENAME with a path
  32. to file, for example $/usr/local/etc/3proxy/conf.incl or
  33. $"c:\\\\Program Files\\3proxy\\include.cfg" Quotation is
  34. required in last example because path contains space character.
  35. For included file <CR> (end of line characters) is treated as space character
  36. (arguments delimiter instead of end of command delimiter).
  37. Thus, include files are only useful to store long signle-line commands
  38. (like userlist, network lists, etc).
  39. To use dollar sign somewhere in argument it must be quoted.
  40. Recursion is not allowed.
  41. .br
  42. Next commands start gateway services:
  43. .br
  44. .B proxy
  45. [options]
  46. .br
  47. .B socks
  48. [options]
  49. .br
  50. .B pop3p
  51. [options]
  52. .br
  53. .B ftppr
  54. [options]
  55. .br
  56. .B admin
  57. [options]
  58. .br
  59. .B dnspr
  60. [options]
  61. .br
  62. .B tcppm
  63. [options]
  64. <SRCPORT> <DSTADDR> <DSTPORT>
  65. .br
  66. .B udppm
  67. [options]
  68. <SRCPORT> <DSTADDR> <DSTPORT>
  69. .br
  70. Descriptions:
  71. .br
  72. .B proxy
  73. HTTP/HTTPS proxy (default port 3128)
  74. .br
  75. .B socks
  76. SOCKS 4/4.5/5 proxy (default port 1080)
  77. .br
  78. .B pop3p
  79. POP3 proxy (default port 110)
  80. .br
  81. .B ftppr
  82. FTP proxy (default port 21)
  83. .br
  84. .B admin
  85. Web interface (default port 80)
  86. .br
  87. .B dnspr
  88. caching DNS proxy (default port 53)
  89. .br
  90. .B tcppm
  91. TCP portmapper
  92. .br
  93. .B udppm
  94. UDP portmapper
  95. .br
  96. Options:
  97. .br
  98. .B -pNUMBER
  99. change default server port to NUMBER
  100. .br
  101. .B -n
  102. disable NTLM authentication (required if passwords are stored in Unix crypt format).
  103. .br
  104. .B -n1
  105. enable NTLMv1 authentication.
  106. .br
  107. .B -s
  108. (for admin) secure, allow only secure operations, currently only traffic counters
  109. view without ability to reset.
  110. .br
  111. (for dnspr) simple, do not use resolver and 3proxy cache, always use external DNS server.
  112. .br
  113. (for udppm) singlepacket, expect only one packet from both client and server
  114. .br
  115. .B -u
  116. Never ask for username/password
  117. .br
  118. .B -u2
  119. (for socks) require username/password in authentication methods
  120. .br
  121. .B -a
  122. (for proxy) anonymous proxy (no information about client reported)
  123. .br
  124. .B -a1
  125. (for proxy) anonymous proxy (random client information reported)
  126. .br
  127. .B -a2
  128. (for proxy) generate Via: and X-Forwared-For: instead of Forwarded:
  129. .br
  130. .B -6
  131. Only resolve IPv6 addresses. IPv4 addresses are packed in IPv6 in IPV6_V6ONLY compatible way.
  132. .br
  133. .B -4
  134. Only resolve IPv4 addresses
  135. .br
  136. .B -46
  137. Resolve IPv6 addresses if IPv4 address is not resolvable
  138. .br
  139. .B -64
  140. Resolve IPv4 addresses if IPv6 address is not resolvable
  141. .br
  142. .B -RHOST:port
  143. listen on given local HOST:port for incoming connections instead of making remote outgoing connection. Can be used with another 3proxy service running -r option for connect back functionality. Most commonly used with tcppm. HOST can be given as IP or hostname, useful in case of dynamic DNS.
  144. .br
  145. .B -rHOST:port
  146. connect to given remote HOST:port instead of listening local connection on -p or default port. Can be used with another 3proxy service running -R option for connect back functionality. Most commonly used with proxy or socks. HOST can be given as IP or hostname, useful in case of dynamic DNS.
  147. .br
  148. .B -ocOPTIONS, -osOPTIONS, -olOPTIONS, -orOPTIONS, -oROPTIONS
  149. options for proxy-to-client (oc), proxy-to-server (os), proxy listening (ol), connect back client (or), connect back listening (oR) sockets.
  150. Options like TCP_CORK, TCP_NODELAY, TCP_DEFER_ACCEPT, TCP_QUICKACK, TCP_TIMESTAMPS, USE_TCP_FASTOPEN, SO_REUSEADDR, SO_REUSEPORT, SO_PORT_SCALABILITY, SO_REUSE_UNICASTPORT, SO_KEEPALIVE, SO_DONTROUTE may be supported depending on OS.
  151. .br
  152. .B -DiINTERFACE, -DeINTERFACE
  153. 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 setcap is used).
  154. .br
  155. Also, all options mentioned for
  156. .BR proxy (8)
  157. .BR socks (8)
  158. .BR pop3p (8)
  159. .BR tcppm (8)
  160. .BR udppm (8)
  161. .BR ftppr (8)
  162. are also supported.
  163. .br
  164. Portmapping services listen at SRCPORT and connect to DSTADDR:DSTPORT
  165. HTTP and SOCKS proxies are standard.
  166. .br
  167. POP3 proxy must be configured as POP3 server and requires username in the form of:
  168. pop3username@pop3server. If POP3 proxy access must be authenticated, you can
  169. specify username as proxy_username:proxy_password:POP3_username@pop3server
  170. .br
  171. DNS proxy resolves any types of records but only hostnames are cached. It
  172. requires nserver/nscache to be configured. If nserver is configured as TCP,
  173. redirections are applied on connection, so parent proxy may be used to resolve
  174. names to IP.
  175. .br
  176. FTP proxy can be used as FTP server in any FTP client or configured as FTP
  177. proxy on a client with FTP proxy support. Username format is one of
  178. .br
  179. FTPuser@FTPServer
  180. .br
  181. FTPuser:FTPpassword@FTPserver
  182. .br
  183. proxyuser:proxypassword:FTPuser:FTPpassword@FTPserver
  184. .br
  185. Please note, if you use FTP client interface for FTP proxy do not add FTPpassword and FTPServer to username, because 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
  186. .br
  187. .B include
  188. <path>
  189. .br
  190. Include config file
  191. .br
  192. .B config
  193. <path>
  194. .br
  195. Path to configuration file to use on 3proxy restart or to save configuration.
  196. .br
  197. .B writable
  198. .br
  199. ReOpens configuration file for write access via Web interface,
  200. and rereads it. Usually should be first command on config file
  201. but in combination with config
  202. it can be used anywhere to open
  203. alternate config file. Think twice before using it.
  204. .br
  205. .B end
  206. .br
  207. End of configuration
  208. .br
  209. .B log
  210. [[@|&]logfile] [<LOGTYPE>]
  211. .br
  212. sets logfile for all gateways
  213. .br
  214. @ (for Unix) use syslog, filename is used as ident name
  215. .br
  216. & use ODBC, filename consists of comma-delimited datasource,username,password (username and password are optional)
  217. .br
  218. LOGTYPE is one of:
  219. .br
  220. M Monthly
  221. .br
  222. W Weekly (starting from Sunday)
  223. .br
  224. D Daily
  225. .br
  226. H Hourly
  227. .br
  228. if logfile is not specified logging goes to stdout. You can specify individual logging options for gateway by using -l
  229. option in gateway configuration.
  230. .br
  231. log command supports same format specifications for filename template
  232. as "logformat" (if filename contains \'%\' sign it\'s believed to be template).
  233. As with "logformat" filename must begin with \'L\' or \'G\' to specify Local or
  234. Grinwitch time zone for all time-based format specificators.
  235. .br
  236. .B rotate
  237. <n>
  238. how many archived log files to keep
  239. .br
  240. .B logformat
  241. <format>
  242. .br
  243. Format for log record. First symbol in format must be L (local time)
  244. or G (absolute Grinwitch time).
  245. It can be preceeded with -XXX+Y where XXX is list of characters to be
  246. filtered in user input (any non-printable characters are filtered too
  247. in this case) and Y is replacement character. For example, "-,%+ L" in
  248. the beginning of logformat means comma and percent are replaced
  249. with space and all time based elemnts are in local time zone.
  250. .br
  251. You can use:
  252. .br
  253. %y Year in 2 digit format
  254. .br
  255. %Y Year in 4 digit format
  256. .br
  257. %m Month number
  258. .br
  259. %o Month abbriviature
  260. .br
  261. %d Day
  262. .br
  263. %H Hour
  264. .br
  265. %M Minute
  266. .br
  267. %S Second
  268. .br
  269. %t Timstamp (in seconds since 01-Jan-1970)
  270. .br
  271. %. milliseconds
  272. .br
  273. %z timeZone (from Grinvitch)
  274. .br
  275. %D request duration (in milliseconds)
  276. .br
  277. %b average send rate per request (in Bytes per second) this speed is typically below connection speed shown by download manager.
  278. .br
  279. %B average receive rate per request (in Bytes per second) this speed is typically below connection speed shown by download manager.
  280. .br
  281. %U Username
  282. .br
  283. %N service Name
  284. .br
  285. %p service Port
  286. .br
  287. %E Error code
  288. .br
  289. %C Client IP
  290. .br
  291. %c Client port
  292. .br
  293. %R Remote IP
  294. .br
  295. %r Remote port
  296. .br
  297. %i Internal IP used to accept client connection
  298. .br
  299. %e External IP used to establish connection
  300. .br
  301. %Q Requested IP
  302. .br
  303. %q Requested port
  304. .br
  305. %n requested hostname
  306. .br
  307. %I bytes In
  308. .br
  309. %O bytes Out
  310. .br
  311. %h Hops (redirections) count
  312. .br
  313. %T service specific Text
  314. .br
  315. %N1-N2T (N1 and N2 are positive numbers) log only fields from N1 thorugh N2 of service specific text
  316. .br
  317. in the case of ODBC logging logformat specifies SQL statement, for exmample:
  318. .br
  319. 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\')"
  320. .br
  321. .B logdump
  322. <in_traffic_limit> <out_traffic_limit>
  323. .br
  324. Immediately creates additional log records if given amount of incoming/outgoing
  325. traffic is achieved for connection, without waiting for connection to finish.
  326. It may be useful to prevent information about long-lasting downloads on server
  327. shutdown.
  328. .br
  329. .B archiver
  330. <ext> <commandline>
  331. .br
  332. Archiver to use for log files. <ext> is file extension produced by
  333. archiver. Filename will be last argument to archiver, optionally you
  334. can use %A as produced archive name and %F as filename.
  335. .br
  336. .B timeouts
  337. <BYTE_SHORT> <BYTE_LONG> <STRING_SHORT> <STRING_LONG> <CONNECTION_SHORT> <CONNECTION_LONG> <DNS> <CHAIN> <CONNECT> <CONNECTBACK>
  338. .br
  339. Sets timeout values, defaults 1, 5, 30, 60, 180, 1800, 15, 60, 15, 5.
  340. .br
  341. BYTE_SHORT short timeout for single byte, is usually used for receiving single byte from stream.
  342. .br
  343. BYTE_LONG long timeout for single byte, is usually used for receiving first byte in frame (for example first byte in socks request).
  344. .br
  345. STRING_SHORT short timeout, for character string within stream (for example to wait between 2 HTTP headers)
  346. .br
  347. STRING_LONG long timeout, for first string in stream (for example to wait for HTTP request).
  348. .br
  349. CONNECTION_SHORT inactivity timeout for short connections (HTTP, POP3, etc).
  350. .br
  351. CONNECTION_LONG inactivity timeout for long connection (SOCKS, portmappers, etc).
  352. .br
  353. DNS timeout for DNS request before requesting next server
  354. .br
  355. CHAIN timeout for reading data from chained connection
  356. .br
  357. default timeouts 1 5 30 60 180 1800 15 60 15 5
  358. .br
  359. .B nserver
  360. <ipaddr>[:port][/tcp]
  361. .br
  362. Nameserver to use for name resolutions. If none specified
  363. system routines for name resolution is
  364. used. Optional port number may be specified.
  365. If optional /tcp is added to IP address, name resolution is
  366. performed over TCP.
  367. .br
  368. .B nscache
  369. <cachesize>
  370. .B nscache6
  371. <cachesize>
  372. .br
  373. Cache <cachesize> records for name resolution (nscache for IPv4,
  374. nscache6 for IPv6). Cachesize usually should be large enougth
  375. (for example 65536).
  376. .br
  377. .B nsrecord
  378. <hostname> <hostaddr>
  379. .br
  380. Adds static record to nscache. nscache must be enabled. If 0.0.0.0
  381. is used as a hostaddr host will never resolve, it can be used to
  382. blacklist something or together with
  383. .B dialer
  384. command to set up UDL for dialing.
  385. .br
  386. .B fakeresolve
  387. .br
  388. All names are resolved to 127.0.0.2 address. Usefull if all requests are
  389. redirected to parent proxy with http, socks4+, connect+ or socks5+.
  390. .br
  391. .B dialer
  392. <progname>
  393. .br
  394. Execute progname if external name can\'t be resolved.
  395. Hint: if you use nscache, dialer may not work, because names will
  396. be resolved through cache. In this case you can use something like
  397. http://dial.right.now/ from browser to set up connection.
  398. .br
  399. .B internal
  400. <ipaddr>
  401. .br
  402. sets ip address of internal interface. This IP address will be used
  403. to bind gateways. Alternatively you can use -i option for individual
  404. gateways. Since 0.8 version, IPv6 address may be used.
  405. .br
  406. .B external
  407. <ipaddr>
  408. .br
  409. sets ip address of external interface. This IP address will be source
  410. address for all connections made by proxy. Alternatively you can use -e
  411. option to specify individual address for gateway. Since 0.8 version
  412. External or -e can be given twice: once with IPv4 and once with IPv6 address.
  413. .br
  414. .B maxconn
  415. <number>
  416. .br
  417. sets maximum number of simulationeous connections to each services
  418. started after this command. Default is 100.
  419. .br
  420. .B service
  421. .br
  422. (depricated). Indicates 3proxy to behave as Windows 95/98/NT/2000/XP
  423. service, no effect for Unix. Not required for 3proxy 0.6 and above. If
  424. you upgraded from previous version of 3proxy use --remove and --install
  425. to reinstall service.
  426. .br
  427. .B daemon
  428. .br
  429. Should be specified to close console. Do not use \'daemon\' with \'service\'.
  430. At least under FreeBSD \'daemon\' should preceed any proxy service
  431. and log commands to avoid sockets problem. Always place it in the beginning
  432. of the configuration file.
  433. .br
  434. .B auth
  435. <authtype> [...]
  436. .br
  437. Type of user authorization. Currently supported:
  438. .br
  439. none - no authentication or authorization required.
  440. .br
  441. Note: is auth is none any ip based limitation, redirection, etc will not work.
  442. This is default authentication type
  443. .br
  444. iponly - authentication by access control list with username ignored.
  445. Appropriate for most cases
  446. .br
  447. useronly - authentication by username without checking for any password with
  448. authorization by ACLs. Useful for e.g. SOCKSv4 proxy and icqpr (icqpr set UIN /
  449. AOL screen name as a username)
  450. .br
  451. dnsname - authentication by DNS hostnname with authorization by ACLs.
  452. DNS hostname is resolved via PTR (reverse) record and validated (resolved
  453. name must resolve to same IP address). It\'s recommended to use authcache by
  454. ip for this authentication.
  455. NB: there is no any password check, name may be spoofed.
  456. .br
  457. strong - username/password authentication required. It will work with
  458. SOCKSv5, FTP, POP3 and HTTP proxy.
  459. .br
  460. cache - cached authentication, may be used with \'authcache\'.
  461. .br
  462. Plugins may add additional authentication types.
  463. .br
  464. It\'s possible to use few authentication types in the same commands. E.g.
  465. .br
  466. auth iponly strong
  467. .br
  468. In this case \'strong\' authentication will be used only in case resource
  469. access can not be performed with \'iponly\' authentication, that is username is
  470. required in ACL. It\'s usefull to protect access to some resources with
  471. password allowing passwordless access to another resources, or to use
  472. IP-based authentication for dedicated laptops and request username/password for
  473. shared ones.
  474. .br
  475. .B authcache
  476. <cachtype> <cachtime>
  477. .br
  478. Cache authentication information to given amount of time (cachetime) in seconds.
  479. Cahtype is one of:
  480. .br
  481. ip - after successful authentication all connections during caching time
  482. from same IP are assigned to the same user, username is not requested.
  483. .br
  484. ip,user username is requested and all connections from the same IP are
  485. assigned to the same user without actual authentication.
  486. .br
  487. user - same as above, but IP is not checked.
  488. .br
  489. user,password - both username and password are checked against cached ones.
  490. .br
  491. Use auth type \'cache\' for cached authentication
  492. .br
  493. .B allow
  494. <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  495. <weekdayslist> <timeperiodslist>
  496. .br
  497. .B deny
  498. <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  499. <weekdayslist> <timeperiodslist>
  500. .br
  501. Access control entries. All lists are comma-separated, no spaces are
  502. allowed. Usernames are case sensitive (if used with authtype nbname
  503. username must be in uppercase). Source and target lists may contain
  504. 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).
  505. Since 0.6, targetlist may also contain host names,
  506. instead of addresses. It\'s possible to use wildmask in
  507. the begginning and in the the end of hostname, e.g. *badsite.com or *badcontent*.
  508. Hostname is only checked if hostname presents in request.
  509. Targetportlist may contain ports (X) or port ranges lists (X-Y). For any field *
  510. sign means ANY. If access list is empty it\'s assumed to be
  511. .br
  512. allow *
  513. .br
  514. If access list is not empty last item in access list is assumed to be
  515. .br
  516. deny *
  517. .br
  518. You may want explicitly add deny * to the end of access list to prevent
  519. HTTP proxy from requesting user\'s password.
  520. Access lists are checked after user have requested any resource.
  521. If you want 3proxy to reject connections from specific addresses
  522. immediately without any conditions you should either bind proxy
  523. to appropriate interface only or to use ip filters.
  524. .br
  525. Operation is one of:
  526. .br
  527. CONNECT establish outgoing TCP connection
  528. .br
  529. BIND bind TCP port for listening
  530. .br
  531. UDPASSOC make UDP association
  532. .br
  533. ICMPASSOC make ICMP association (for future use)
  534. .br
  535. HTTP_GET HTTP GET request
  536. .br
  537. HTTP_PUT HTTP PUT request
  538. .br
  539. HTTP_POST HTTP POST request
  540. .br
  541. HTTP_HEAD HTTP HEAD request
  542. .br
  543. HTTP_CONNECT HTTP CONNECT request
  544. .br
  545. HTTP_OTHER over HTTP request
  546. .br
  547. HTTP matches any HTTP request except HTTP_CONNECT
  548. .br
  549. HTTPS same as HTTP_CONNECT
  550. .br
  551. FTP_GET FTP get request
  552. .br
  553. FTP_PUT FTP put request
  554. .br
  555. FTP_LIST FTP list request
  556. .br
  557. FTP_DATA FTP data connection. Note: FTP_DATA requires access to dynamic
  558. non-ptivileged (1024-65535) ports on remote side.
  559. .br
  560. FTP matches any FTP/FTP Data request
  561. .br
  562. ADMIN access to administration interface
  563. .br
  564. Weeksdays are week days numbers or periods, 0 or 7 means Sunday, 1 is Monday, 1-5 means Monday through Friday.
  565. .br
  566. Timeperiodlists is a list of time
  567. 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.
  568. .br
  569. .B parent
  570. <weight> <type> <ip> <port> <username> <password>
  571. .br
  572. this command must follow "allow" rule. It extends last allow rule to
  573. build proxy chain. Proxies may be grouped. Proxy inside the
  574. group is selected randomly. If few groups are specified one proxy
  575. is randomly picked from each group and chain of proxies is created
  576. (that is second proxy connected through first one and so on).
  577. Weight is used to group proxies. Weigt is a number between 1 and 1000.
  578. Weights are summed and proxies are grouped together untill weight of
  579. group is 1000. That is:
  580. .br
  581. allow *
  582. .br
  583. parent 500 socks5 192.168.10.1 1080
  584. .br
  585. parent 500 connect 192.168.10.1 3128
  586. .br
  587. makes 3proxy to randomly choose between 2 proxies for all outgoing
  588. connections. These 2 proxies form 1 group (summarized weight is 1000).
  589. .br
  590. allow * * * 80
  591. .br
  592. parent 1000 socks5 192.168.10.1 1080
  593. .br
  594. parent 1000 connect 192.168.20.1 3128
  595. .br
  596. parent 300 socks4 192.168.30.1 1080
  597. .br
  598. parent 700 socks5 192.168.40.1 1080
  599. .br
  600. creates chain of 3 proxies: 192.168.10.1, 192.168.20.1 and third
  601. is (192.168.30.1 with probability of 0.3 or 192.168.40.1
  602. with probability of 0.7) for outgoing web connections.
  603. .br
  604. type is one of:
  605. .br
  606. 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.
  607. .br
  608. http redirect to HTTP proxy. HTTP is always last chain. It should only be used with http (proxy) service,
  609. if used with different service, it works as tcp redirection.
  610. .br
  611. pop3 redirect to POP3 proxy (only local redirection is supported, can only be used as a first hop in chaining)
  612. .br
  613. ftp redirect to FTP proxy (only local redirection is supported, can only be used as a first hop in chaining)
  614. .br
  615. connect parent is HTTP CONNECT method proxy
  616. .br
  617. connect+ parent is HTTP CONNECT proxy with name resolution (hostname is used instead of IP if available)
  618. .br
  619. socks4 parent is SOCKSv4 proxy
  620. .br
  621. socks4+ parent is SOCKSv4 proxy with name resolution (SOCKSv4a)
  622. .br
  623. socks5 parent is SOCKSv5 proxy
  624. .br
  625. socks5+ parent is SOCKSv5 proxy with name resolution
  626. .br
  627. socks4b parent is SOCKS4b (broken SOCKSv4 implementation with shortened
  628. server reply. I never saw this kind ofservers byt they say there are).
  629. Normally you should not use this option. Do not mess this option with
  630. SOCKSv4a (socks4+).
  631. .br
  632. socks5b parent is SOCKS5b (broken SOCKSv5 implementation with shortened
  633. server reply. I think you will never find it useful). Never use this option
  634. unless you know exactly you need it.
  635. .br
  636. admin redirect request to local \'admin\' service (with -s parameter).
  637. .br
  638. Use "+" proxy only with "fakeresolve" option
  639. .br
  640. IP and port are ip addres and port of parent proxy server.
  641. If IP is zero, ip is taken from original request, only port is changed.
  642. If port is zero, it\'s taken from original request, only IP is changed.
  643. If both IP and port are zero - it\'s a special case of local redirection,
  644. it works only with
  645. .B socks
  646. proxy. In case of local redirection request is redirected to different service,
  647. .B ftp
  648. locally redirects to
  649. .B ftppr
  650. .B pop3
  651. locally redirects to
  652. .B pop3p
  653. .B http
  654. locally redurects to
  655. .B proxy
  656. .B admin
  657. locally redirects to admin -s service.
  658. .br
  659. Main purpose of local redirections is to have requested resource
  660. (URL or POP3 username) logged and protocol-specific filters to be applied.
  661. In case of local redirection ACLs are revied twice: first, by SOCKS proxy up to \'parent\'
  662. command and then with gateway service connection is
  663. redirected (HTTP, FTP or POP3) after \'parent\' command. It means,
  664. additional \'allow\' command is required for redirected requests, for
  665. example:
  666. .br
  667. allow * * * 80
  668. .br
  669. parent 1000 http 0.0.0.0 0
  670. .br
  671. allow * * * 80 HTTP_GET,HTTP_POST
  672. .br
  673. socks
  674. .br
  675. redirects all SOCKS requests with target port 80 to local HTTP proxy,
  676. local HTTP proxy parses requests and allows only GET and POST requests.
  677. .br
  678. parent 1000 http 1.2.3.4 0
  679. .br
  680. Changes external address for given connection to 1.2.3.4 (an equivalent to -e1.2.3.4)
  681. .br
  682. Optional username and password are used to authenticate on parent
  683. proxy. Username of \'*\' means username must be supplied by user.
  684. .br
  685. .B nolog
  686. <n>
  687. .br
  688. extends last allow or deny command to prevent logging, e.g.
  689. .br
  690. allow * * 192.168.1.1
  691. .br
  692. nolog
  693. .br
  694. .B weight
  695. <n>
  696. .br
  697. extends last allow or deny command to set weight for this request
  698. .br
  699. allow * * 192.168.1.1
  700. .br
  701. weight 100
  702. .br
  703. Weight may be used for different purposes.
  704. .br
  705. .B force
  706. .br
  707. .B noforce
  708. .br
  709. If force is specified for service, configuration reload will require all current
  710. sessions of this service to be re-authenticated. If ACL is changed or user account
  711. is removed, old connections which do not match current are closed.
  712. noforce allows to keep previously authenticated connections.
  713. .br
  714. .B bandlimin
  715. <rate> <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  716. <weekdayslist> <timeperiodslist>
  717. .br
  718. .B nobandlimin
  719. <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  720. <weekdayslist> <timeperiodslist>
  721. .br
  722. .B bandlimout
  723. <rate> <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  724. <weekdayslist> <timeperiodslist>
  725. .br
  726. .B nobandlimout
  727. <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  728. <weekdayslist> <timeperiodslist>
  729. .br
  730. bandlim sets bandwith limitation filter to <rate> bps (bits per second)
  731. If you want to specife bytes per second - multiply your value to 8.
  732. bandlim rules act in a same manner as allow/deny rules except
  733. one thing: bandwidth limiting is applied to all services, not to some
  734. specific service.
  735. bandlimin and nobandlimin applies to incoming traffic
  736. bandlimout and nobandlimout applies to outgoing traffic
  737. If tou want to ratelimit your clients with IPs 192.168.10.16/30 (4
  738. addresses) to 57600 bps you have to specify 4 rules like
  739. .br
  740. bandlimin 57600 * 192.168.10.16
  741. .br
  742. bandlimin 57600 * 192.168.10.17
  743. .br
  744. bandlimin 57600 * 192.168.10.18
  745. .br
  746. bandlimin 57600 * 192.168.10.19
  747. .br
  748. and every of you clients will have 56K channel. If you specify
  749. .br
  750. bandlimin 57600 * 192.168.10.16/30
  751. .br
  752. you will have 56K channel shared between all clients.
  753. if you want, for example, to limit all speed ecept access to POP3 you can use
  754. .br
  755. nobandlimin * * * 110
  756. .br
  757. before the rest of bandlim rules.
  758. .br
  759. .B connlim
  760. <rate> <period> <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  761. <weekdayslist> <timeperiodslist>
  762. .br
  763. .B noconnlim
  764. <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  765. <weekdayslist> <timeperiodslist>
  766. .br
  767. connlim sets connections rate limit per time period for traffic
  768. pattern controlled by ACL. Period is in seconds. If period is 0,
  769. connlim limits a number of parallel connections.
  770. .br
  771. connlim 100 60 * 127.0.0.1
  772. .br
  773. allows 100 connections per minute for 127.0.0.1.
  774. .br
  775. connlim 20 0 * 127.0.0.1
  776. .br
  777. allows 20 simulationeous connections for 127.0.0.1.
  778. .br
  779. Like with bandlimin, if individual limit is required per client, separate
  780. rule mustbe added for every client. Like with nobanlimin, noconnlim adds an
  781. exception.
  782. .br
  783. .B counter
  784. <filename> <reporttype> <repotname>
  785. .br
  786. .B countin
  787. <number> <type> <limit> <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  788. <weekdayslist> <timeperiodslist>
  789. .br
  790. .B nocountin
  791. <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  792. <weekdayslist> <timeperiodslist>
  793. .br
  794. .B countout
  795. <number> <type> <limit> <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  796. <weekdayslist> <timeperiodslist>
  797. .br
  798. .B nocountout
  799. <userlist> <sourcelist> <targetlist> <targetportlist> <operationlist>
  800. <weekdayslist> <timeperiodslist>
  801. .br
  802. counter, countin, nocountin, countout, noucountout commands are
  803. used to set traffic limit
  804. in MB for period of time (day, week or month). Filename is a path
  805. to a special file where traffic information is permanently stored.
  806. number is sequential number of record in this file. If number is 0
  807. no traffic information on this counter is saved in file (that is
  808. if proxy restarted all information is loosed) overwise it should be
  809. unique sequential number.
  810. Type specifies a type of counter. Type is one of:
  811. .br
  812. H - counter is resetted hourly
  813. .br
  814. D - counter is resetted daily
  815. .br
  816. W - counter is resetted weekly
  817. .br
  818. M - counter is resetted monthely
  819. .br
  820. reporttype/repotname may be used to generate traffic reports.
  821. Reporttype is one of D,W,M,H(hourly) and repotname specifies filename
  822. template for reports. Report is text file with counter values in
  823. format:
  824. .br
  825. <COUNTERNUMBER> <TRAF>
  826. .br
  827. The rest of parameters is identical to bandlim/nobandlim.
  828. .br
  829. .B users
  830. username[:pwtype:password] ...
  831. .br
  832. pwtype is one of:
  833. .br
  834. none (empty) - use system authentication
  835. .br
  836. CL - password is cleartext
  837. .br
  838. CR - password is crypt-style password
  839. .br
  840. NT - password is NT password (in hex)
  841. .br
  842. example:
  843. .br
  844. users test1:CL:password1 "test2:CR:$1$lFDGlder$pLRb4cU2D7GAT58YQvY49."
  845. .br
  846. users test3:NT:BD7DFBF29A93F93C63CB84790DA00E63
  847. .br
  848. Note: double quotes are requiered because password contains $ sign.
  849. .br
  850. .B flush
  851. .br
  852. empty active access list. Access list must be flushed avery time you creating
  853. new access list for new service. For example:
  854. .br
  855. allow *
  856. .br
  857. pop3p
  858. .br
  859. flush
  860. .br
  861. allow * 192.168.1.0/24
  862. .br
  863. socks
  864. .br
  865. sets different ACLs for
  866. .B pop3p
  867. and
  868. .B socks
  869. .br
  870. .B system
  871. <command>
  872. .br
  873. execute system command
  874. .br
  875. .B pidfile
  876. <filename>
  877. .br
  878. write pid of current process to file. It can be used to manipulate
  879. 3proxy with signals under Unix. Currently next signals are available:
  880. .br
  881. .B monitor
  882. <filename>
  883. .br
  884. If file monitored changes in modification time or size, 3proxy reloads
  885. configuration within one minute. Any number of files may be monitored.
  886. .br
  887. .B setuid
  888. <uid>
  889. .br
  890. calls setuid(uid), uid can be numeric or since 0.9 username. Unix only. Warning: under some Linux
  891. kernels setuid() works for current thread only. It makes it impossible to suid
  892. for all threads.
  893. .br
  894. .B setgid
  895. <gid>
  896. .br
  897. calls setgid(gid), gid can be numeric or since 0.9 groupname. Unix only.
  898. .br
  899. .B chroot
  900. <path> [<uid>] [<gid>]
  901. .br
  902. calls chroot(path) and sets gid/uid. Unix only. uid/gid supported since 0.9, can be numeric or username/groupname
  903. .br
  904. .B stacksize
  905. <value_to_add_to_default_stack_size>
  906. .br
  907. Change default size for threads stack. May be required in some situation,
  908. e.g. with non-default plugins, on on some platforms (some FreeBSD version
  909. may require adjusting stack size due to invalid defined value in system
  910. header files, this value is also oftent reqruied to be changed for ODBC and
  911. PAM support on Linux. If you experience 3proxy
  912. crash on request processing, try to set some positive value. You may start with
  913. stacksize 65536
  914. and then find the minimal value for service to work. If you experience
  915. memory shortage, you can try to experiment with negative values.
  916. .SH PLUGINS
  917. .br
  918. .B plugin
  919. <path_to_shared_library> <function_to_call> [<arg1> ...]
  920. .br
  921. Loads specified library and calls given export function with given arguments,
  922. as
  923. .br
  924. int functions_to_call(struct pluginlink * pl, int argc, char * argv[]);
  925. .br
  926. function_to_call must return 0 in case of success, value > 0 to indicate error.
  927. .br
  928. .B filtermaxsize
  929. <max_size_of_data_to_filter>
  930. .br
  931. If Content-length (or another data length) is greater than given value, no
  932. data filtering will be performed thorugh filtering plugins to avoid data
  933. corruption and/or Content-Length chaging. Default is 1MB (1048576).
  934. .SH BUGS
  935. Report all bugs to
  936. .BR 3proxy@3proxy.ru
  937. .SH SEE ALSO
  938. 3proxy(8), proxy(8), ftppr(8), socks(8), pop3p(8), tcppm(8), udppm(8), syslogd(8),
  939. .br
  940. https://3proxy.org/
  941. .SH TRIVIA
  942. 3APA3A is pronounced as \`\`zaraza\'\'.
  943. .SH AUTHORS
  944. 3proxy is designed by Vladimir 3APA3A Dubrovin
  945. .RI ( 3proxy@3proxy.ru )