- Notifications
You must be signed in to change notification settings - Fork1
License
NotificationsYou must be signed in to change notification settings
Swaagie/envoy-rbi-filter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Envoy filter written in Rust to provide Reponse Body Injection (RBI). This requiresEnvoy's WASM filters
rustup target add wasm32-wasip1cargo build --target wasm32-wasip1
Release build
rustup target add wasm32-wasip1cargo build --target wasm32-wasip1 --release
Add the WASM filter configuration tohttp_filters
as part of Envoy's HTTP Connection Management configuration.
-name:envoy.filters.http.wasmtyped_config:"@type":type.googleapis.com/udpa.type.v1.TypedStructtype_url:type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasmvalue:config:name:"rbi_filter"root_id:"rbi_filter_id"configuration:"@type":"type.googleapis.com/google.protobuf.StringValue"value:| { "hello": "<h1>Hello WASM</h1>" }vm_config:runtime:"envoy.wasm.runtime.v8"vm_id:"rbi_injection_vm_id"code:local:filename:"/etc/envoy/envoy_rbi_filter.wasm"configuration:{}
To run the example local:
cargo build --target wasm32-wasidocker compose up --build --file ./example/docker-compose.yaml
Send the local running cluster traffic:
curl -vvv http://localhost:10000/# * Trying ::1...# * TCP_NODELAY set# ...# * Connection #0 to host localhost left intact# <html><body><h1>Hello WASM</h1></body></html># * Closing connection 0
End to end integration tests require theexample to run local.
cargotest