https://github.com/peterj/envoy-introspection
https://github.com/peterj/envoy-introspection
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/peterj/envoy-introspection
- Owner: peterj
- Created: 2021-11-30T01:03:01.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-30T01:05:49.000Z (over 4 years ago)
- Last Synced: 2025-07-18T02:22:13.586Z (11 months ago)
- Language: Go
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Envoy introspection
## Demo
1. Build the extension (.wasm file):
```
make wasm
```
2. Start the upstream service:
```sh
docker run -d -p 3030:80 kennethreitz/httpbin
```
3. Run the Envoy instance using func-e:
```sh
func-e run -c envoy.yaml &
```
4. Send a request using the `intercept: 1` header to intercept the call:
```sh
curl -H "intercept: 1" localhost:10000/get
```
Notice in the output the call is intercepted and a request is made to the same cluster and the callback function is called:
```sh
$ curl -H "intercept: 1" localhost:10000/1
[2021-11-30 01:02:33.159][14834][info][wasm] [source/extensions/common/wasm/context.cc:1167] wasm log: intercepting call!!
[2021-11-30 01:02:33.159][14834][info][wasm] [source/extensions/common/wasm/context.cc:1167] wasm log: cluster name: httpbin_1
[2021-11-30 01:02:33.163][14834][info][wasm] [source/extensions/common/wasm/context.cc:1167] wasm log: called callBack func
{
"args": {},
"headers": {
"Accept": "*/*",
"Host": "localhost:10000",
"Intercept": "1",
"User-Agent": "curl/7.64.0",
"X-Envoy-Expected-Rq-Timeout-Ms": "15000",
"X-Envoy-Original-Path": "/1"
},
"origin": "172.18.0.1",
"url": "http://localhost:10000/get"
}
```