Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: telemetry/third_party/tsproxy/README.md

Issue 2516973005: Update ts_proxy to latest commit (Closed)
Patch Set: Sync further Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « telemetry/third_party/tsproxy/README.chromium ('k') | telemetry/third_party/tsproxy/tsproxy.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # tsproxy 1 # tsproxy
2 Traffic-shaping SOCKS5 proxy 2 Traffic-shaping SOCKS5 proxy
3 3
4 tsproxy provides basic latency, download and upload traffic shaping while only r equiring user-level access (no root permissions required). It should work for b asic browser testing but for protocol-level work it does not provide a suitable replacement for something like dummynet or netem. 4 tsproxy provides basic latency, download and upload traffic shaping while only r equiring user-level access (no root permissions required). It should work for b asic browser testing but for protocol-level work it does not provide a suitable replacement for something like dummynet or netem.
5 5
6 tsproxy is monolithic and all of the functionality is in tsproxy.py. It is writ ten expecting Python 2.7. 6 tsproxy is monolithic and all of the functionality is in tsproxy.py. It is writ ten expecting Python 2.7.
7 7
8 #Usage 8 #Usage
9 ```bash 9 ```bash
10 $ python tsproxy.py --rtt=<latency> --inkbps=<download bandwidth> --outkbps=<upl oad bandwidth> 10 $ python tsproxy.py --rtt=<latency> --inkbps=<download bandwidth> --outkbps=<upl oad bandwidth>
11 ``` 11 ```
12 Hit ctrl-C (or send a SIGINT) to exit 12 Hit `ctrl-C` (or send a `SIGINT`) to exit
13 13
14 #Example 14 #Example
15 ```bash 15 ```bash
16 $ python tsproxy.py --rtt=200 --inkbps=1600 --outkbps=768 16 $ python tsproxy.py --rtt=200 --inkbps=1600 --outkbps=768
17 ``` 17 ```
18 18
19 #Command-line Options 19 #Command-line Options
20 * **-r, --rtt** : Latency in milliseconds (full round trip, half of the latency gets applied to each direction). 20
21 * **-i, --inkbps** : Download Bandwidth (in 1000 bits/s - Kbps). 21
22 * **-o, --outkbps** : Upload Bandwidth (in 1000 bits/s - Kbps). 22 | Option | Alias | Description |
23 * **-w, --window** : Emulated TCP initial congestion window (defaults to 10). 23 | ----------------- | -------- | ---------------------------------------- |
24 * **-p, --port** : SOCKS 5 proxy port (defaults to port 1080). Specifying a port of 0 will use a randomly assigned port. 24 | **`--rtt`** | **`-r`** | Latency in milliseconds (full round trip, half of the latency gets applied to each direction). |
25 * **-b, --bind** : Interface address to listen on (defaults to localhost). 25 | **`--inkbps`** | **`-i`** | Download Bandwidth (in 1000 bits/s - Kbps). |
26 * **-d, --desthost** : Redirect all outbound connections to the specified host ( name or IP). 26 | **`--outkbps`** | **`-o`** | Upload Bandwidth (in 1000 bits/s - Kbps). |
27 * **-m, --mapports** : Remap outbound ports. Comma-separated list of original:ne w with * as a wildcard. --mapports '443:8443,*:8080' 27 | **`--window`** | **`-w`** | Emulated TCP initial congestion window (default s to 10). |
28 * **-l, --localhost** : Include connections already destined for localhost/127.0 .0.1 in the host and port remapping. 28 | **`--port`** | **`-p`** | SOCKS 5 proxy port (defaults to port 1080). Spe cifying a port of 0 will use a randomly assigned port. |
29 * **-v, --verbose** : Increase verbosity (specify multiple times for more). -vvv v for full debug output. 29 | **`--bind`** | **`-b`** | Interface address to listen on (defaults to loc alhost). |
30 | **`--desthost`** | **`-d`** | Redirect all outbound connections to the specif ied host (name or IP). |
31 | **`--mapports`** | **`-m`** | Remap outbound ports. Comma-separated list of o riginal:new with * as a wildcard. `--mapports '443:8443,*:8080'` |
32 | **`--localhost`** | **`-l`** | Include connections already destined for localh ost/127.0.0.1 in the host and port remapping. |
33 | **`--verbose`** | **`-v`** | Increase verbosity (specify multiple times for more). `-vvvv` for full debug output. |
34
30 35
31 #Runtime Options 36 #Runtime Options
32 The traffic shaping configuration can be changed dynamically at runtime by passi ng commands in through the console (or stdin). Each command is on a line, termi nated with an end-of-line (\n). 37 The traffic shaping configuration can be changed dynamically at runtime by passi ng commands in through the console (or stdin). Each command is on a line, termi nated with an end-of-line (`\n`).
33 38
34 39
35 * **flush** : Flush queued data out of the pipes. Useful for clearing out any a ccumulated background data between tests. 40 * **`flush`** : Flush queued data out of the pipes. Useful for clearing out any accumulated background data between tests.
36 * **set rtt <latency>** : Change the connection latency. i.e. "set rtt 200\n" wi ll change to a 200ms RTT. 41 * **`set rtt <latency>`** : Change the connection latency. i.e. `set rtt 200\n` will change to a 200ms RTT.
37 * **set inkbps <bandwidth>** : Change the download bandwidth. i.e. "set inkbps 5 000\n" will change to a 5Mbps download connection. 42 * **`set inkbps <bandwidth>`** : Change the download bandwidth. i.e. `set inkbps 5000\n` will change to a 5Mbps download connection.
38 * **set outkbps <bandwidth>** : Change the upload bandwidth. i.e. "set outkbps 1 000\n" will change to a 1Mbps upload connection. 43 * **`set outkbps <bandwidth>`** : Change the upload bandwidth. i.e. `set outkbps 1000\n` will change to a 1Mbps upload connection.
39 * **set mapports <port mapping string>** : Change the destination port mapping. 44 * **`set mapports <port mapping string>`** : Change the destination port mapping .
45 * **`reset all`** : Disable all port mapping and traffic shaping
46 * **`reset rtt`** : Set latency to 0
47 * **`reset inkbps`** : Disable download traffic shaping
48 * **`reset outkbps`** : Disable upload traffic shaping
49 * **`reset mapports`** : Disable destination port mapping
40 50
41 All bandwidth and latency changes also carry an implied flush and clear out any pending data. 51 All bandwidth and latency changes also carry an implied flush and clear out any pending data.
42 52
43 53
44 #Configuring Chrome to use tsproxy 54 #Configuring Chrome to use tsproxy
45 Add a --proxy-server command-line option. 55 Add a --proxy-server command-line option.
46 ``` 56 ```bash
47 --proxy-server="socks://localhost:1080" 57 --proxy-server="socks://localhost:1080"
48 ``` 58 ```
49 59
50 #Known Shortcomings/Issues 60 #Known Shortcomings/Issues
51 * DNS lookups on OSX (and FreeBSD) will block each other when it comes to actual ly resolving. DNS in Python on most platforms is allowed to run concurrently in threads (which tsproxy does) but on OSX and FreeBSD it is not thread-safe and t here is a lock around the actual lookups. For most cases this isn't an issue be cause the latency isn't added on the actual DNS lookup (it is from the browser p erspective but it is added outside of the actual lookup). This is also not an is sue when desthost is used to override the destination address since dns lookups will be disabled. 61 * DNS lookups on OSX (and FreeBSD) will block each other when it comes to actual ly resolving. DNS in Python on most platforms is allowed to run concurrently in threads (which tsproxy does) but on OSX and FreeBSD it is not thread-safe and t here is a lock around the actual lookups. For most cases this isn't an issue be cause the latency isn't added on the actual DNS lookup (it is from the browser p erspective but it is added outside of the actual lookup). This is also not an is sue when desthost is used to override the destination address since dns lookups will be disabled.
62 * QUIC support. Chrome [doesn't currently support QUIC proxies](https://bugs.chr omium.org/p/chromium/issues/detail?id=335275), and further work would be neccess ary to correctly handle UDP traffic in tsproxy.
OLDNEW
« no previous file with comments | « telemetry/third_party/tsproxy/README.chromium ('k') | telemetry/third_party/tsproxy/tsproxy.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698