Skip to content

Example of consuming Envoy and adding a custom filter

Notifications You must be signed in to change notification settings

jmarantz/envoy-filter-example

This branch is 15848 commits behind envoyproxy/envoy-filter-example:main.

Folders and files

NameName
Last commit message
Last commit date
Mar 2, 2018
May 5, 2017
Feb 8, 2019
Mar 1, 2019
Oct 1, 2018
Oct 19, 2018
May 7, 2018
May 5, 2017
Sep 15, 2017
Dec 20, 2017
Sep 13, 2018
Feb 4, 2019
Jul 23, 2018
Feb 2, 2018
Jul 18, 2018
Mar 1, 2019
Nov 28, 2018
Nov 5, 2018
Jun 28, 2017

Repository files navigation

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 filter. Integration tests demonstrating the filter's end-to-end behavior are also provided.

For an example of additional HTTP filters, see here.

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 is provided as a submodule. The WORKSPACE file maps the @envoy repository to this local path.

The BUILD file introduces a new Envoy static binary target, envoy, that links together the new filter and @envoy//source/exe:envoy_main_lib. The echo2 filter registers itself during the static initialization phase of the Envoy binary as a new filter.

About

Example of consuming Envoy and adding a custom filter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 71.9%
  • Python 22.6%
  • Shell 5.5%