-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathindex.html
455 lines (296 loc) · 22.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="description" content="Tinyproxy : lightweight http(s) proxy daemon">
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<title>Tinyproxy</title>
</head>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<a id="forkme_banner" href="https://github.com/tinyproxy">View on GitHub</a>
<h1 id="project_title">Tinyproxy</h1>
<h2 id="project_tagline">lightweight http(s) proxy daemon</h2>
</header>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<h1>
<a id="tinyproxy" class="anchor" href="#tinyproxy" aria-hidden="true"><span class="octicon octicon-link"></span></a>Tinyproxy</h1>
<p>Tinyproxy is a light-weight HTTP/HTTPS proxy daemon for POSIX operating systems. Designed from the ground up to be fast and yet small, it is an ideal solution for use cases such as embedded deployments where a full featured HTTP proxy is required, but the system resources for a larger proxy are unavailable.</p>
<p>Tinyproxy is distributed using the GNU GPL license (version 2 or above).</p>
<h2>
<a id="features" class="anchor" href="#features" aria-hidden="true"><span class="octicon octicon-link"></span></a>Features</h2>
<p>Tinyproxy has a <strong>small footprint</strong> and requires very little in the way of system resources. The memory footprint tends to be around 2 MB with glibc, and the CPU load increases linearly with the number of simultaneous connections (depending on the speed of the connection). Thus, Tinyproxy can be run on an older machine, or on a network appliance such as a Linux-based broadband router, without any noticeable impact on performance.</p>
<p>Tinyproxy requires only a <strong>minimal POSIX environment</strong> to build and operate. It can use additional libraries to add functionality though.</p>
<p>Tinyproxy allows forwarding of <strong>HTTPS connections</strong> without modifying traffic in any way through the <code>CONNECT</code> method (see the <code>ConnectPort</code> directive, which you should disable, unless you want to restrict the users).</p>
<p>Tinyproxy supports being configured as a <strong>transparent proxy</strong>, so that a proxy can be used without requiring any client-side configuration. You can also use it as a <strong>reverse proxy</strong> front-end to your websites.</p>
<p>Using the <code>AddHeader</code> directive, you can <strong>add/insert HTTP headers</strong> to outgoing traffic (HTTP only).</p>
<p>If you're looking to build a custom web proxy, Tinyproxy is <strong>easy to modify</strong> to your custom needs. The source is straightforward, adhering to the KISS principle. As such, it can be used as a foundation for anything you may need a web proxy to do.</p>
<p>Tinyproxy has <strong>privacy features</strong> which can let you configure which HTTP headers should be allowed through, and which should be blocked. This allows you to restrict both what data comes to your web browser from the HTTP server (e.g., cookies), and to restrict what data is allowed through from your web browser to the HTTP server (e.g., version information). Note that these features do not affect HTTPS connections.</p>
<p>Using the <strong>remote monitoring</strong> facility, you can access proxy statistics from afar, letting you know exactly how busy the proxy is.</p>
<p>You can configure Tinyproxy to <strong>control access</strong> by only allowing requests from a certain subnet, or from a certain interface, thus ensuring that random, unauthorized people will not be using your proxy.</p>
<p>With a bit of configuration (specifically, making Tinyproxy created files owned by a non-root user and running it on a port greater than 1024), Tinyproxy can be made to run without any special privileges, thus minimizing the chance of system compromise. In fact, it is <b>recommended</b> to run it as a regular/restricted user. Furthermore, it was designed with an eye towards preventing buffer overflows. The simplicity of the code ensures it remains easy to spot such bugs.</p>
<h2>
<a id="downloads" class="anchor" href="#downloads" aria-hidden="true"><span class="octicon octicon-link"></span></a>Downloads</h2>
<p>Note that many distributions ship horribly outdated versions of tinyproxy, therefore it is recommended to compile it from source.</p>
<ul>
<li>On Red Hat Enterprise Linux, or its derivatives such as CentOS, install Tinyproxy from the EPEL repository by running yum install tinyproxy.</li>
<li>On Fedora, install Tinyproxy by running yum install tinyproxy.</li>
<li>On Debian and derived distributions, run apt-get install tinyproxy to install Tinyproxy.</li>
<li>For openSUSE run: zypper in tinyproxy</li>
<li>Arch users can install the Tinyproxy package from the community repository. Run pacman -S tinyproxy to install it.</li>
<li>FreeBSD, OpenBSD or NetBSD users can use the pkg_add utility to install the tinyproxy package.</li>
<li>Mac OS X users can check MacPorts to see if the Tinyproxy port there is recent enough.</li>
</ul>
<p>If you feel that the Tinyproxy binary package in your operating system is not recent (likely), please contact the package maintainer for that particular operating system. If this fails, you can always compile the latest stable, or even better, the latest git master version, from source code.</p>
<p>We distribute Tinyproxy in source code form, and it has to be compiled in order to be used on your system. Please see the INSTALL file in the source code tree for build instructions. The current stable version of Tinyproxy is available on the <a href="https://github.com/tinyproxy/tinyproxy/releases">releases page</a>. The Tinyproxy NEWS file contains the release notes. You can verify the tarball using its PGP signature. You can also browse the older releases of Tinyproxy.</p>
<p>We use Git as the version control system for the Tinyproxy source code repository. To get a copy of the Tinyproxy repository, use the command:</p>
<p>git clone <a href="https://github.com/tinyproxy/tinyproxy.git">https://github.com/tinyproxy/tinyproxy.git</a></p>
<h2>
<a id="quickstart" class="anchor" href="#quickstart" aria-hidden="true"><span class="octicon octicon-link"></span></a>Quickstart</h2>
<p>The quickest way to get started is using a minimal config file like the below:</p>
<pre><code>
Port 8888
Listen 127.0.0.1
Timeout 600
Allow 127.0.0.1
</code></pre>
<p>And then simply run <code>tinyproxy -d -c tinyproxy.conf</code> as your current user. This starts tinyproxy in foreground mode with <code>tinyproxy.conf</code> as its config, while logging to stdout. Now, all programs supporting a HTTP proxy can use 127.0.0.1:8888 as a proxy. You can try it out using <code>http_proxy=127.0.0.1:8888 curl example.com</code>.</p>
<h2>
<a id="documentation" class="anchor" href="#documentation" aria-hidden="true"><span class="octicon octicon-link"></span></a>Documentation</h2>
<h4 id="NAME">NAME</h4>
<p>tinyproxy.conf - Tinyproxy HTTP proxy daemon configuration file</p>
<h4 id="SYNOPSIS">SYNOPSIS</h4>
<p><b>tinyproxy.conf</b></p>
<h4 id="DESCRIPTION">DESCRIPTION</h4>
<p><a href="http://man.he.net/man8/tinyproxy">tinyproxy(8)</a> reads its configuration file, typically stored in `/etc/tinyproxy/tinyproxy.conf` (or passed to Tinyproxy with -c on the command line). This manpage describes the syntax and contents of the configuration file.</p>
<p>The Tinyproxy configuration file contains key-value pairs, one per line. Lines starting with `#` and empty lines are comments and are ignored. Keywords are case-insensitive, whereas values are case-sensitive. Values may be enclosed in double-quotes (") if they contain spaces.</p>
<p>The possible keywords and their descriptions are as follows:</p>
<dl>
<dt id="User"><b>User</b></dt>
<dd>
<p>The user which the Tinyproxy process should run as, after the initial port-binding has been done as the `root` user. Either the user name or the UID may be specified.</p>
</dd>
<dt id="Group"><b>Group</b></dt>
<dd>
<p>The group which the Tinyproxy process should run as, after the initial port-binding has been done as the `root` user. Either the group name or the GID may be specified.</p>
</dd>
<dt id="Port"><b>Port</b></dt>
<dd>
<p>The port which the Tinyproxy service will listen on. If the port is less than 1024, you will need to start the Tinyproxy process as the `root` user.</p>
</dd>
<dt id="Listen"><b>Listen</b></dt>
<dd>
<p>By default, Tinyproxy listens for connections on all available interfaces (i.e. it listens on the wildcard address `0.0.0.0`). With this configuration parameter, Tinyproxy can be told to listen only on one specific address.</p>
</dd>
<dt id="Bind"><b>Bind</b></dt>
<dd>
<p>This allows you to specify which address Tinyproxy will bind to for outgoing connections to web servers or upstream proxies. This parameter may be specified multiple times, then Tinyproxy will try all the specified addresses in order.</p>
</dd>
<dt id="BindSame"><b>BindSame</b></dt>
<dd>
<p>If this boolean parameter is set to `yes`, then Tinyproxy will bind the outgoing connection to the IP address of the incoming connection that triggered the outgoing request.</p>
</dd>
<dt id="Timeout"><b>Timeout</b></dt>
<dd>
<p>The maximum number of seconds of inactivity a connection is allowed to have before it is closed by Tinyproxy.</p>
</dd>
<dt id="ErrorFile"><b>ErrorFile</b></dt>
<dd>
<p>This parameter controls which HTML file Tinyproxy returns when a given HTTP error occurs. It takes two arguments, the error number and the location of the HTML error file.</p>
</dd>
<dt id="DefaultErrorFile"><b>DefaultErrorFile</b></dt>
<dd>
<p>This parameter controls the HTML template file returned when an error occurs for which no specific error file has been set.</p>
</dd>
<dt id="StatHost"><b>StatHost</b></dt>
<dd>
<p>This configures the host name or IP address that is treated as the `stat host`: Whenever a request for this host is received, Tinyproxy will return an internal statistics page instead of forwarding the request to that host. The template for this page can be configured with the `StatFile` configuration option. The default value of `StatHost` is `tinyproxy.stats`.</p>
</dd>
<dt id="StatFile"><b>StatFile</b></dt>
<dd>
<p>This configures the HTML file that Tinyproxy sends when a request for the stathost is received. If this parameter is not set, Tinyproxy returns a hard-coded basic statistics page. See the STATHOST section in the <a href="http://man.he.net/man8/tinyproxy">tinyproxy(8)</a> manual page for details.</p>
<p>Note that the StatFile and the error files configured with ErrorFile and DefaultErrorFile are template files that can contain a few template variables that Tinyproxy expands prior to delivery. Examples are "{cause}" for an abbreviated error description and "{detail}" for a detailed error message. The <a href="http://man.he.net/man8/tinyproxy">tinyproxy(8)</a> manual page contains a description of all template variables.</p>
</dd>
<dt id="LogFile"><b>LogFile</b></dt>
<dd>
<p>This controls the location of the file to which Tinyproxy writes its debug output. Alternatively, Tinyproxy can log to syslog -- see the Syslog option.</p>
</dd>
<dt id="Syslog"><b>Syslog</b></dt>
<dd>
<p>When set to `On`, this option tells Tinyproxy to write its debug messages to syslog instead of to a log file configured with `LogFile`. These two options are mutually exclusive.</p>
</dd>
<dt id="LogLevel"><b>LogLevel</b></dt>
<dd>
<p>Sets the log level. Messages from the set level and above are logged. For example, if the LogLevel was set to Warning, then all log messages from Warning to Critical would be output, but Notice and below would be suppressed. Allowed values are:</p>
<ul>
<li><p>Critical (least verbose)</p>
</li>
<li><p>Error</p>
</li>
<li><p>Warning</p>
</li>
<li><p>Notice</p>
</li>
<li><p>Connect (log connections without Info's noise)</p>
</li>
<li><p>Info (most verbose)</p>
</li>
</ul>
</dd>
<dt id="PidFile"><b>PidFile</b></dt>
<dd>
<p>This option controls the location of the file where the main Tinyproxy process stores its process ID for signaling purposes.</p>
</dd>
<dt id="XTinyproxy"><b>XTinyproxy</b></dt>
<dd>
<p>Setting this option to `Yes` tells Tinyproxy to add a header `X-Tinyproxy` containing the client's IP address to the request.</p>
</dd>
<dt id="Upstream"><b>Upstream</b></dt>
<dd>
<p>This option allows you to set up a set of rules for deciding whether an upstream proxy server is to be used, based on the host or domain of the site being accessed. The rules are stored in the order encountered in the configuration file and the LAST matching rule wins. The following forms for specifying upstream rules exist:</p>
<ul>
<li><p><i>upstream type host:port</i> turns proxy upstream support on generally.</p>
</li>
<li><p><i>upstream type user:pass@host:port</i> does the same, but uses the supplied credentials for authentication.</p>
</li>
<li><p><i>upstream type host:port "site_spec"</i> turns on the upstream proxy for the sites matching `site_spec`.</p>
<p>`type` can be one of `http`, `socks4`, `socks5`, `none`.</p>
</li>
<li><p><i>upstream none "site_spec"</i> turns off upstream support for sites matching `site_spec`, that means the connection is done directly.</p>
</li>
</ul>
<p>The site can be specified in various forms as a hostname, domain name or as an IP range:</p>
<ul>
<li><p><i>name</i> matches host exactly</p>
</li>
<li><p><i>.name</i> matches any host in domain "name"</p>
</li>
<li><p><i>.</i> matches any host with no domain (in 'empty' domain)</p>
</li>
<li><p><i>IP/bits</i> matches network/mask</p>
</li>
<li><p><i>IP/mask</i> matches network/mask</p>
</li>
</ul>
<p>Note that the upstream directive can also be used to null-route a specific target domain/host, e.g.: `upstream http 0.0.0.0:0 ".adserver.com"`</p>
</dd>
<dt id="MaxClients"><b>MaxClients</b></dt>
<dd>
<p>Tinyproxy creates one thread for each connected client. This options specifies the absolute highest number processes that will be created. With other words, only MaxClients clients can be connected to Tinyproxy simultaneously.</p>
</dd>
<dt id="Allow"><b>Allow</b></dt>
<dd>
</dd>
<dt id="Deny"><b>Deny</b></dt>
<dd>
<p>The `Allow` and `Deny` options provide a means to customize which clients are allowed to access Tinyproxy. `Allow` and `Deny` lines can be specified multiple times to build the access control list for Tinyproxy. The order in the config file is important. If there are no `Allow` or `Deny` lines, then all clients are allowed. Otherwise, the default action is to deny access. The argument to `Allow` or `Deny` can be a single IP address of a client host, like `127.0.0.1`, an IP address range, like `192.168.0.1/24` or a string that will be matched against the end of the client host name, i.e, this can be a full host name like `host.example.com` or a domain name like `.example.com` or even a top level domain name like `.com`. Note that by adding a rule using a host or domain name, a costly name lookup has to be done for every new connection, which could slow down the service considerably.</p>
</dd>
<dt id="BasicAuth"><b>BasicAuth</b></dt>
<dd>
<p>Configure HTTP "Basic Authentication" username and password for accessing the proxy. If there are any entries specified, access is only granted for authenticated users.</p>
<pre><code>BasicAuth user password</code></pre>
</dd>
<dt id="AddHeader"><b>AddHeader</b></dt>
<dd>
<p>Configure one or more HTTP request headers to be added to outgoing HTTP requests that Tinyproxy makes. Note that this option will not work for HTTPS traffic, as Tinyproxy has no control over what headers are exchanged.</p>
<pre><code>AddHeader "X-My-Header" "Powered by Tinyproxy"</code></pre>
</dd>
<dt id="ViaProxyName"><b>ViaProxyName</b></dt>
<dd>
<p>RFC 2616 requires proxies to add a `Via` header to the HTTP requests, but using the real host name can be a security concern. If the `ViaProxyname` option is present, then its string value will be used as the host name in the Via header. Otherwise, the server's host name will be used.</p>
</dd>
<dt id="DisableViaHeader"><b>DisableViaHeader</b></dt>
<dd>
<p>When this is set to yes, Tinyproxy does NOT add the `Via` header to the requests. This virtually puts Tinyproxy into stealth mode. Note that RFC 2616 requires proxies to set the `Via` header, so by enabling this option, you break compliance. Don't disable the `Via` header unless you know what you are doing...</p>
</dd>
<dt id="Filter"><b>Filter</b></dt>
<dd>
<p>Tinyproxy supports filtering of web sites based on URLs or domains. This option specifies the location of the file containing the filter rules, one rule per line.</p>
<p>Rules are specified as POSIX basic regular expressions (BRE), unless another FilterType is specified. Comment lines start with a `#` character.</p>
<p>Example filter file contents:</p>
<pre><code> # filter exactly cnn.com
^cnn\.com$
# filter all subdomains of cnn.com, but not cnn.com itself
.*\.cnn.com$
# filter any domain that has cnn.com in it, like xcnn.comfy.org
cnn\.com
# filter any domain that ends in cnn.com
cnn\.com$
# filter any domain that starts with adserver
^adserver</code></pre>
</dd>
<dt id="FilterType"><b>FilterType</b></dt>
<dd>
<p>This option can be set to one of `bre`, `ere`, or `fnmatch`. If `bre` is set, the rules specified in the filter file are matched using POSIX basic regular expressions, when set to `ere`, using POSIX extended regular expressions, and when set to `fnmatch` using the `fnmatch` function as specified in the manpage `man 3p fnmatch`. `fnmatch` matching is identical to what's used in the shell to match filenames, so for example `*.google.com` matches everything that ends with `.google.com`. If you don't know what regular expressions are or you're using filter lists from 3rd party sources, `fnmatch` is probably what you want. It's also the fastest matching method of the three.</p>
</dd>
<dt id="FilterURLs"><b>FilterURLs</b></dt>
<dd>
<p>If this boolean option is set to `Yes` or `On`, filtering is performed for URLs rather than for domains. The default is to filter based on domains.</p>
<p>Note that filtering for URLs works only in plain HTTP scenarios. Since HTTPS has become ubiquitous during the last years, this will only work on a tiny fraction of websites, so it is recommended not to use this option.</p>
</dd>
<dt id="FilterExtended"><b>FilterExtended</b></dt>
<dd>
<p>Deprecated. Use `FilterType ere` instead. If this boolean option is set to `Yes`, then extended POSIX regular expressions are used for matching the filter rules. The default is to use basic POSIX regular expressions.</p>
</dd>
<dt id="FilterCaseSensitive"><b>FilterCaseSensitive</b></dt>
<dd>
<p>If this boolean option is set to `Yes`, then the filter rules are matched in a case sensitive manner. The default is to match case-insensitively, unfortunately. If you set this to `Yes`, then your matching will be almost twice as fast. This setting affects only `bre` and `ere` FilterTypes, fnmatch is always case sensitive.</p>
</dd>
<dt id="FilterDefaultDeny"><b>FilterDefaultDeny</b></dt>
<dd>
<p>The default filtering policy is to allow everything that is not matched by a filtering rule. Setting `FilterDefaultDeny` to `Yes` changes the policy do deny everything but the domains or URLs matched by the filtering rules. In other words, if set to `No` the Filter list acts as a blacklist, if set to `Yes` as a whitelist.</p>
</dd>
<dt id="Anonymous"><b>Anonymous</b></dt>
<dd>
<p>If an `Anonymous` keyword is present, then anonymous proxying is enabled. The headers listed with `Anonymous` are allowed through, while all others are denied. If no Anonymous keyword is present, then all headers are allowed through. You must include quotes around the headers.</p>
<p>Most sites require cookies to be enabled for them to work correctly, so you will need to allow cookies through if you access those sites.</p>
<p>Example:</p>
<pre><code>Anonymous "Host"
Anonymous "Authorization"
Anonymous "Cookie"</code></pre>
</dd>
<dt id="ConnectPort"><b>ConnectPort</b></dt>
<dd>
<p>This option can be used to specify the ports allowed for the CONNECT method. If no `ConnectPort` line is found, then all ports are allowed. To disable CONNECT altogether, include a single ConnectPort line with a value of `0`.</p>
</dd>
<dt id="ReversePath"><b>ReversePath</b></dt>
<dd>
<p>Configure one or more ReversePath directives to enable reverse proxy support. With reverse proxying it's possible to make a number of sites appear as if they were part of a single site.</p>
<p>If you uncomment the following two directives and run Tinyproxy on your own computer at port 8888, you can access example.com, using http://localhost:8888/example/.</p>
<pre><code>ReversePath "/example/" "http://www.example.com/"</code></pre>
</dd>
<dt id="ReverseOnly"><b>ReverseOnly</b></dt>
<dd>
<p>When using Tinyproxy as a reverse proxy, it is STRONGLY recommended that the normal proxy is turned off by setting this boolean option to `Yes`.</p>
</dd>
<dt id="ReverseMagic"><b>ReverseMagic</b></dt>
<dd>
<p>Setting this option to `Yes`, makes Tinyproxy use a cookie to track reverse proxy mappings. If you need to reverse proxy sites which have absolute links you must use this option.</p>
</dd>
<dt id="ReverseBaseURL"><b>ReverseBaseURL</b></dt>
<dd>
<p>The URL that is used to access this reverse proxy. The URL is used to rewrite HTTP redirects so that they won't escape the proxy. If you have a chain of reverse proxies, you'll need to put the outermost URL here (the address which the end user types into his/her browser). If this option is not set then no rewriting of redirects occurs.</p>
</dd>
</dl>
<h2>
<a id="support" class="anchor" href="#support" aria-hidden="true"><span class="octicon octicon-link"></span></a>Support</h2>
<ul>
<li>Feel free to report a new bug or suggest features via github issues.</li>
<li>Tinyproxy developers hang out in #tinyproxy on irc.libera.chat.</li>
</ul>
</section>
</div>
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p>Published with <a href="https://pages.github.com">GitHub Pages</a></p>
</footer>
</div>
</body>
</html>