Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/envoyproxy/envoy-filter-example
Example of consuming Envoy and adding a custom filter
https://github.com/envoyproxy/envoy-filter-example
Last synced: 1 day ago
JSON representation
Example of consuming Envoy and adding a custom filter
- Host: GitHub
- URL: https://github.com/envoyproxy/envoy-filter-example
- Owner: envoyproxy
- Created: 2017-04-25T19:13:26.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T23:26:11.000Z (3 months ago)
- Last Synced: 2024-04-14T08:07:03.152Z (2 months ago)
- Language: C++
- Size: 2.88 MB
- Stars: 323
- Watchers: 36
- Forks: 200
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
Lists
- awesome-bazel - Envoy example
README
# Envoy filter example
This project demonstrates the linking of additional filters with the Envoy binary.
A new filter `echo2` is introduced, identical modulo renaming to the existing
[`echo`](https://github.com/envoyproxy/envoy/blob/master/source/extensions/filters/network/echo/echo.h)
filter. Integration tests demonstrating the filter's end-to-end behavior are
also provided.For an example of additional HTTP filters, see [here](http-filter-example).
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/envoyproxy/envoy-filter-example/badge)](https://securityscorecards.dev/viewer/?uri=github.com/envoyproxy/envoy-filter-example)
## Building
To build the Envoy static binary:
1. `git submodule update --init`
2. `bazel build //:envoy`## Testing
To run the `echo2` integration test:
`bazel test //:echo2_integration_test`
To run the regular Envoy tests from this project:
`bazel test @envoy//test/...`
## How it works
The [Envoy repository](https://github.com/envoyproxy/envoy/) is provided as a submodule.
The [`WORKSPACE`](WORKSPACE) file maps the `@envoy` repository to this local path.The [`BUILD`](BUILD) file introduces a new Envoy static binary target, `envoy`,
that links together the new filter and `@envoy//source/exe:envoy_main_entry_lib`. The
`echo2` filter registers itself during the static initialization phase of the
Envoy binary as a new filter.