Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/pages/simulations/multiple-hosts-delay-simulation.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"globalActions": {
"delays": [
{
"urlPattern": "time\\.jsontest\\.com",
"urlPattern": "api\\.ipify\\.org",
"httpMethod": "",
"delay": 1000
},
{
"urlPattern": "date\\.jsontest\\.com",
"urlPattern": "httpbin\\.org",
"httpMethod": "",
"delay": 2000
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
hoverctl start
hoverctl mode capture
curl --proxy localhost:8500 http://time.jsontest.com
curl --proxy localhost:8500 http://date.jsontest.com
curl --proxy localhost:8500 https://api.ipify.org
curl --proxy localhost:8500 https://httpbin.org
hoverctl export simulation.json
hoverctl stop
hoverctl stop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
hoverctl start
hoverctl import simulation.json
curl --proxy localhost:8500 http://time.jsontest.com
curl --proxy localhost:8500 http://date.jsontest.com
curl --proxy localhost:8500 https://api.ipify.org
curl --proxy localhost:8500 https://httpbin.org
hoverctl stop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Applying different delays based on host
=======================================

Now let's apply a delay of 1 second on responses from ``time.jsontest.com`` and a delay of 2 seconds on responses from ``date.jsontest.com``.
Now let's apply a delay of 1 second on responses from ``api.ipify.org`` and a delay of 2 seconds on responses from ``httpbin.org``.

Run the following to create and export a simulation.

Expand All @@ -20,7 +20,7 @@ Now run the following to import the edited ``simulation.json`` file and run the
.. literalinclude:: delays-simulate.sh
:language: sh

You should notice a 1 second delay on responses from ``time.jsontest.com``, and a 2 second delay on responses from ``date.jsontest.com``.
You should notice a 1 second delay on responses from ``api.ipify.org``, and a 2 second delay on responses from ``httpbin.org``.


.. note::
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
hoverctl start
hoverctl destination "ip" --dry-run http://ip.jsontest.com
hoverctl destination "ip" --dry-run http://time.jsontest.com
hoverctl stop
hoverctl destination "ip" --dry-run https://api.ipify.org
hoverctl destination "ip" --dry-run https://httpbin.org
hoverctl stop
6 changes: 3 additions & 3 deletions docs/pages/tutorials/basic/specificurls/filter-dest.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
hoverctl start
hoverctl destination "ip"
hoverctl mode capture
curl --proxy http://localhost:8500 http://ip.jsontest.com
curl --proxy http://localhost:8500 http://time.jsontest.com
curl --proxy http://localhost:8500 https://api.ipify.org
curl --proxy http://localhost:8500 https://httpbin.org
hoverctl logs
hoverctl export simulation.json
hoverctl stop
hoverctl stop
8 changes: 4 additions & 4 deletions docs/pages/tutorials/basic/specificurls/specificurls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ will filter out URLs as required.
.. literalinclude:: filter-dest-dry-run.sh
:language: sh

This tells us that setting the destination to ``ip`` will allow the URL ``http://ip.jsontest.com`` to be captured or simulated, while the URL
``http://time.jsontest.com`` will be ignored.
This tells us that setting the destination to ``ip`` will allow the URL ``https://api.ipify.org`` to be captured or simulated, while the URL
``https://httpbin.org`` will be ignored.


Now we have checked the destination setting, we can apply it to filter out the URLs we don't want to capture.

.. literalinclude:: filter-dest.sh
:language: sh

If we examine the logs and the ``simulation.json`` file, we can see that `only` a request response pair to the ``http://ip.jsontest.com``
If we examine the logs and the ``simulation.json`` file, we can see that `only` a request response pair to the ``https://api.ipify.org``
URL has been captured.

The destination setting can be either a string or a regular expression.
Expand All @@ -28,4 +28,4 @@ The destination setting can be either a string or a regular expression.
:language: sh

Here, we can see that setting the destination to ``^.*api.*com`` will allow the ``https://api.github.com`` and ``https://api.slack.com``
URLs to be captured or simulated, while the ``https://github.com`` URL will be ignored.
URLs to be captured or simulated, while the ``https://github.com`` URL will be ignored.
Loading