Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebAssembly plugins #685

Open
Geal opened this issue Jul 29, 2021 · 1 comment
Open

WebAssembly plugins #685

Geal opened this issue Jul 29, 2021 · 1 comment

Comments

@Geal
Copy link
Member

Geal commented Jul 29, 2021

I would like to introduce wasm plugins at these points:

  • main process, for small tasks that can change the configuration (talking to a service discovery, etc)
  • routing filter, deciding on different routes to applications than what the main router would do
  • request and response filters: editing header, body, overriding responses, etc

We can get inspiration from Envoy's wasm filters: https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/wasm/v3/wasm.proto

@marc-barry
Copy link

After using and being part of the Envoy Wasm experiment I'd strongly encourage you to not focus on Wasm middleware but rather dynamic module support so that any language that can be compiled to a shared object can be used.

As an example, see envoyproxy/envoy#35420. There is an effort underway in Envoy which dates way back to 2017 (envoyproxy/envoy#2053) to add loadable modules. Work is underway to start this with envoyproxy/envoy#35550 and is based on https://github.com/mathetake/envoy-dynamic-modules. The ABI is simple and straightforward and the SDK directory contains examples for both Go and Rust (https://github.com/mathetake/envoy-dynamic-modules/tree/main/source/extensions/dynamic_modules/sdk).

Going in the direction of loadable modules offers flexibility and simplicity and building a loadable module which brings in a Wasm runtime becomes relatively simple. It also allows for easy customization of the proxy through an extension pattern which means that the proxy can be extended without polluting the codebase with extensions of various quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants