Is it possible to create custom middleware?

Pretty straightforward question. Is it possible to create custom middleware in v2?


There are no current ways to create custom middleware in v2.0-alpha8 (unless of course you compile your own Traefik with your custom middleware).

On a side note, adding middleware should be a straightforward operation since the architecture has been improved in order to make contributions/updates easier on that part.

Got it, and thank you for your reply. I was hoping I could write my own custom middleware that is specific for our needs. Not sure I want to work on a fork of it, I will find another way to solve what I'm after. Thanks.

My example for custom middleware )

I wonder if there are any future plans for it. It would be neat if we could use official traefik binaries with our own middleware. I googled a bit and it appears that in golang plugins are a pain. There is however hashicorp gRPC-based implementation, which looks promising.

So while writing middleware may be less complex, getting traefik to load it is a different story. Maintaining a custom build of traefik and merging it all the time, may be beyond reach of most of the customers.

If I write a cool middleware and wanted to share it with other traefik users, it could be challenging. A way for official container / binaries to install / load plugins would be nice.

1 Like

Apparently there is a years old github issue about that. Still open :wink:

1 Like

I make draft PR )

1 Like