Skip to content

blndfsk/plugin-wasm-rust-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plugin-wasm-rust-demo

Demo Traefik plugin written in rust. Inspired by https://github.com/juliens/traefik-plugin-rust-demo

This plugin filters incoming requests dependent on the configuration.

Building

if not already installed, add the wasm-target

rustup target add wasm32-wasip1

Build the plugin with

make

The artifacts are found in target/plugin/

Installation

This Demo is not meant for installation, it is just a showcase. However, traefik supports a manual installation.

mkdir -p <traefik>/plugins-local/src/plugindemowasm/
cp target/plugin/plugin.wasm <traefik>/plugins-local/src/plugindemowasm/

Configure the static configuration (and restart traefik)

# Static configuration

experimental:
  localPlugins:
    plugindemowasm:
      moduleName: plugindemowasm

Call the middleware from one of your routers

# Dynamic configuration

http:
  routers:
    my-router:
    [...]
      middlewares:
        - plugindemowasm-mw
[...]
  middlewares:
    plugindemowasm-mw:
      plugin:
        plugindemowasm:
          rules:
            - ""

About

traefik wasm middleware written in rust

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published