3proxy.cfg.3 25 KB

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