3proxy.cfg.3 27 KB

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