Only do this the first time.
$ git clone https://github.com/chromium/web-page-replay.git
$ cd web-page-replay
On Linux, Dummynet must be installed to simulate network conditions.
$ tar -C /tmp -xvzf ipfw3-20120119.tgz $ cd /tmp/ipfw3-20120119 $ make [Ignore output like the following:] echo " ERROR: Kernel configuration is invalid.";\ echo " include/generated/autoconf.h or include/config/auto.conf are missing.";\ echo " Run 'make oldconfig && make prepare' on kernel src to fix it.";\ [The lines will print without "echo" if there is an actual error.] $ sudo insmod dummynet2/ipfw_mod.ko $ sudo cp ipfw/ipfw /usr/local/sbin
$ sudo rmmod ipfw_mod.ko
Windows support is experimental and not well tested. On Windows XP, the Dummynet driver must be installed to simulate network conditions (Drivers for Windows Vista and Windows 7 are currently unavailable).
First you must record the web page or pages that you wish to replay.
$ sudo ./replay.py --record ~/archive.wpr
After you have created an archive, you may later replay it at any time.
$ sudo ./replay.py ~/archive.wpr
During replay, you may simulate desired network conditions. This is useful for benchmarking.
$ sudo ./replay.py --up 128KByte/s --down 4Mbit/s --delay_ms=100 archive.wpr
$ sudo ./replay.py --packet_loss_rate=0.01 ~/archive.wpr
You may choose to disable the forwarding of DNS requests to the local replay server. If DNS request forwarding is disabled, an external mechanism must be used to forward traffic to the replay server.
$ ./replay.py --no-dns_forwarding --record ~/archive.wpr
Alternatively, traffic forwarding may also be configured via command line flags.
$ google-chrome --host-resolver-rules="MAP * 127.0.0.1:80,EXCLUDE localhost"
By default, Web Page Replay, creates a self-signed certificate to serve SSL traffic. In order for it to work, browsers need to be configured to ignore certificate errors. Be aware that doing so opens a giant security hole.
$ google-chrome --ignore-certificate-errors
Firefox has a configuration file for exceptions. That requires listing each host that gets used. If you have a better solution, please add it to the comments below. IE and Safari options are also needed.
To turn off SSL support, run replay.py with “--no-ssl”.
On Linux, either of the following two errors are permission problems:
python: can't open file './replay.py': [Errno 13] Permission denied
Traceback (most recent call last): File "./replay.py", line 50, in <module> import dnsproxy File "/home/slamm/p/wpr/dnsproxy.py", line 19, in <module> import platformsettings ImportError: No module named platformsettings
This can happen if you checkout the files to an NFS directory. Either move the files to a local directory, or make them world readable/executable.
WPR can cause autofs to hang. On Ubuntu, the following command fixes it:
$ sudo restart autofs
For full usage instructions and advanced options, see the program's help.
$ ./replay.py --help