3proxy.cfg.3 24 KB

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