Skip to content

Commit

Permalink
README: Cache Server: Document
Browse files Browse the repository at this point in the history
  • Loading branch information
pdxjohnny committed Nov 15, 2023
1 parent 1d8e1ee commit d9033a6
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,47 @@ setup(
]
)
```

## Cache Server

Run the caceh server and use it's URL in place of the upstream URL whatever you want to intercept on

```console
$ httptest-cache --state-dir .cache/httptest --addr 0.0.0.0 --port 7000 http://localhost:8000
Serving on http://localhost:7000
```

Inspect cached objects in the cache dir

```console
$ python -c 'import sys, pathlib, pickle, pprint; pprint.pprint(pickle.loads(pathlib.Path(sys.argv[-1]).read_bytes()).headers)' .cache/httptest/f31bc77712e808fffdab85a33631e414f25715588b1a026d6b8a4e0171b67e99859ab71b1933c93b0078d1e47da9a929.request.pickle
{'Accept': '*/*',
'Accept-encoding': 'gzip',
'Connection': 'close',
'Content-length': '8159',
'Content-type': 'application/json',
'Host': 'localhost:45709',
'Request-hmac': '1700084205.d96d4f546acedddc142b1168642a74c738685d1ac4aa07984e9a1850bb73ddee',
'User-agent': 'GitHub-Hookshot/dc69923',
'X-as': '',
'X-country': '',
'X-forwarded-for': '10.56.101.48',
'X-forwarded-proto': 'https',
'X-github-delivery': '12dac8d6-83ff-11ee-97c9-119c09045ae0',
'X-github-event': 'push',
'X-github-hook-id': '443288828',
'X-github-hook-installation-target-id': '621131680',
'X-github-hook-installation-target-type': 'repository',
'X-github-request-id': '1271:336E:974AC:15C2D2:655539ED',
'X-glb-edge-region': 'iad',
'X-glb-edge-site': 'ash1-iad',
'X-glb-via': 'hostname=glb-proxy-1c66317.ash1-iad.github.net site=ash1-iad '
'region=iad service=kube-public t=1700084205.902',
'X-haproxy-ssl-fc-cipher': 'TLS_AES_128_GCM_SHA256',
'X-haproxy-ssl-fc-protocol': 'TLSv1.3',
'X-haproxy-ssl-fc-use-keysize': '128',
'X-real-ip': '10.56.101.48',
'X-region': '',
'X-request-start': 't=1700084205915930',
'X-ssl-ja3-hash': '7a15285d4efc355608b304698cd7f9ab'}
```

0 comments on commit d9033a6

Please sign in to comment.