{"id":13875928,"url":"https://github.com/layer5io/wasm-filters","last_synced_at":"2025-04-19T10:49:36.889Z","repository":{"id":43456229,"uuid":"262100733","full_name":"layer5io/wasm-filters","owner":"layer5io","description":"A collection of Rust-based WebAssembly programs that are deployed as Envoy filters.","archived":false,"fork":false,"pushed_at":"2023-08-19T19:04:24.000Z","size":1641,"stargazers_count":93,"open_issues_count":6,"forks_count":34,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-16T04:44:54.804Z","etag":null,"topics":["data-plane","envoy-filter","envoy-proxy","envoyproxy","hacktoberfest","layer5","meshery","rust","service-mesh","upstream","wasm","wasm-filters","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/layer5io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-05-07T16:21:26.000Z","updated_at":"2025-04-03T07:23:55.000Z","dependencies_parsed_at":"2024-01-13T19:40:34.911Z","dependency_job_id":"0a7bbf5b-58d7-432b-8400-644eb1c81038","html_url":"https://github.com/layer5io/wasm-filters","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layer5io%2Fwasm-filters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layer5io%2Fwasm-filters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layer5io%2Fwasm-filters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layer5io%2Fwasm-filters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/layer5io","download_url":"https://codeload.github.com/layer5io/wasm-filters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249677437,"owners_count":21309554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-plane","envoy-filter","envoy-proxy","envoyproxy","hacktoberfest","layer5","meshery","rust","service-mesh","upstream","wasm","wasm-filters","webassembly"],"created_at":"2024-08-06T06:00:50.562Z","updated_at":"2025-04-19T10:49:36.870Z","avatar_url":"https://github.com/layer5io.png","language":"Rust","funding_links":[],"categories":["Rust","webassembly"],"sub_categories":[],"readme":"\u003cp style=\"text-align:center;\" align=\"center\"\u003e\n      \u003cpicture align=\"center\"\u003e\n         \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"img\\readme\\layer5-light-no-trim.svg\"\u003e\n         \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"img\\readme\\layer5-no-trim.svg\"\u003e\n         \u003cimg align=\"center\" src=\"./.github/assets/images/layer5/layer5-no-trim.svg\" alt=\"Shows a dark layer5 logo in light mode and a white logo in dark mode\" width=\"45%\"/\u003e\n      \u003c/picture\u003e\n\u003c/p\u003e\n\n![GitHub contributors](https://img.shields.io/github/contributors/layer5io/layer5.svg)\n![GitHub](https://img.shields.io/github/license/layer5io/layer5.svg) \n![GitHub issues by-label](https://img.shields.io/github/issues/layer5io/layer5/help%20wanted.svg?color=%23DDDD00)\n[![Slack](https://img.shields.io/badge/Slack-@layer5.svg?logo=slack)](http://slack.layer5.io)\n![Twitter Follow](https://img.shields.io/twitter/follow/layer5.svg?label=Follow\u0026style=social)\n\n# WebAssembly Filters for Envoy\n\nA collection of WebAssemby filters for Envoy proxy written in C,C++,C# and Rust for exercising different features provided by envoy-wasm.\n\nSee the [Image Hub](https://layer5.io/projects/image-hub) as a related project (a sample application). Also, see Meshery's filter management capabitilies.\n\n### Weekly Meeting Details\n\nSee all community meeting details --\u003e https://meet.layer5.io\n\n- Topic: WebAssembly Filters Meeting\n- Day: Weekly on Mondays\n- Time: 7:30pm IST / 3:00pm UK / 9:00am Central\n- WASM Filters call: https://meet.layer5.io/wasm\n- Meeting Minutes: https://bit.ly/3zGZgGg\n\n---\n\n## Join the Community!\n\n\u003ca name=\"contributing\"\u003e\u003c/a\u003e\u003ca name=\"community\"\u003e\u003c/a\u003e\nOur projects are community-built and welcome collaboration. 👍 Be sure to see the \u003ca href=\"https://docs.google.com/document/d/17OPtDE_rdnPQxmk2Kauhm3GwXF1R5dZ3Cj8qZLKdo5E/edit\"\u003eLayer5 Community Welcome Guide\u003c/a\u003e for a tour of resources available to you and jump into our \u003ca href=\"http://slack.layer5.io\"\u003eSlack\u003c/a\u003e!\n\n\u003ca href=\"https://slack.meshery.io\"\u003e\n\n\u003cpicture align=\"right\"\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"img\\readme\\slack-dark-128.png\"  width=\"110px\" align=\"right\" style=\"margin-left:10px;margin-top:10px;\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"img\\readme\\slack-128.png\" width=\"110px\" align=\"right\" style=\"margin-left:10px;padding-top:5px;\"\u003e\n  \u003cimg alt=\"Shows an illustrated light mode meshery logo in light color mode and a dark mode meshery logo dark color mode.\" src=\"img\\readme\\slack-128.png\" width=\"110px\" align=\"right\" style=\"margin-left:10px;padding-top:13px;\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://meshery.io/community\"\u003e\u003cimg alt=\"Layer5 Community\" src=\"img\\readme\\community.svg\" style=\"margin-right:8px;padding-top:5px;\" width=\"140px\" align=\"left\" /\u003e\u003c/a\u003e\n\n\u003cp\u003e\n✔️ \u003cem\u003e\u003cstrong\u003eJoin\u003c/strong\u003e\u003c/em\u003e \u003ca href=\"https://meet.layer5.io\"\u003ecommunity meetings\u003c/a\u003e. See details on the \u003ca href=\"https://calendar.google.com/calendar/b/1?cid=bGF5ZXI1LmlvX2VoMmFhOWRwZjFnNDBlbHZvYzc2MmpucGhzQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20\"\u003eLayer5 community calendar\u003c/a\u003e.\u003cbr /\u003e\n✔️ \u003cem\u003e\u003cstrong\u003eWatch\u003c/strong\u003e\u003c/em\u003e community \u003ca href=\"https://www.youtube.com/Layer5io?sub_confirmation=1\"\u003emeeting recordings\u003c/a\u003e.\u003cbr /\u003e\n✔️ \u003cem\u003e\u003cstrong\u003eAccess\u003c/strong\u003e\u003c/em\u003e the Community Drive by completing a community \u003ca href=\"https://layer5.io/newcomer\"\u003eMember Form\u003c/a\u003e.\u003cbr /\u003e\n✔️ \u003cem\u003e\u003cstrong\u003eDiscuss\u003c/strong\u003e\u003c/em\u003e in the \u003ca href=\"https://discuss.layer5.io\"\u003eCommunity Forum\u003c/a\u003e.\u003cbr /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ci\u003eNot sure where to start?\u003c/i\u003e Grab an open issue with the \u003ca href=\"https://github.com/issues?q=is%3Aopen+is%3Aissue+archived%3Afalse+org%3Alayer5io+org%3Ameshery+org%3Aservice-mesh-performance+org%3Aservice-mesh-patterns+label%3A%22help+wanted%22+\"\u003ehelp-wanted label\u003c/a\u003e.\n\u003c/p\u003e\n\n\u003cdiv\u003e\u0026nbsp;\u003c/div\u003e\n\n### About Layer5\n\n[Layer5](https://layer5.io)'s cloud native application and infrastructure management software enables organizations to expect more from their infrastructure. We embrace developer-defined infrastructure. We empower engineer to change how they write applications, support operators in rethinking how they run modern infrastructure and enable product owners to regain full control over their product portfolio.\n\n\n## Get the Rust toolchain\n\nTo compile Rust filters to WASM, the nightly toolchain and support for wasm compilation target is needed.\nMake sure you have Rust and Cargo installed [using Rustup](https://www.rust-lang.org/tools/install).\nIf you're on a *nix system (Unix, Linux, MacOS), in the project root directory, run:\n```bash\nmake rust-toolchain\n```\nThis will also install wasm-pack for you.\nAlso, take a look at [installing wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) for OS other than *nix.\n\n## Upstream\n\nUpstream is a webserver which is used by few of the filters mentioned above. It provides a route for :\n\n* Mock authentication\n* Storing Metrics\n* Retrieving Metrics\n\n\u003e Build the docker Image for Upstream before proceeding with the examples.\n\nBuild Image:\n```bash\ncd upstream\nmake\n```\n\n## HTTP-Auth\n\nSimulates handling authentication of requests at proxy level. Requests with a header `token` with value `hello` are accepted as authorized while the rest unauthorized. The actual authentication is handled by the Upstream server. Whenever the proxy recieves a request it extracts the `token` header and makes a request to the Upstream server which validates the token and returns a response.\n\nBuild and deploy:\n```bash\ncd http-auth\nmake run-filtered\n```\n\nTest:\n```bash\ncurl  -H \"token\":\"hello\" 0.0.0.0:18000 -v # Authorized\ncurl  -H \"token\":\"world\" 0.0.0.0:18000 -v # Unauthorized\n```\n\n## TCP-Metrics\n\nCollects simple metrics for every TCP packet and logs it.\n\nBuild and deploy:\n```bash\ncd tcp-metrics\nmake run-filtered\n```\n\nTest:\n```bash\ncurl 0.0.0.0:18000 -v -d \"request body\"\n```\n\nCheck the logs for the metrics.\n\n## TCP-Packet-Parse\n\nParses the contents of every TCP packet the proxy receives and logs it.\n\nBuild and deploy:\n```bash\ncd tcp-packet-parse\nmake run-filtered\n```\n\nTest:\n```bash\ncurl 0.0.0.0:18000 -v -d \"request body\"\n```\n\nCheck the logs for the packet contents.\n\n## Singleton-HTTP-Call\n\nAn example which depicts an singleton HTTP WASM service which does an HTTP call once every 2 seconds.\n\nBuild and deploy:\n```bash\ncd singleton-http-call\nmake run-filtered\n```\n\nCheck the logs for the response of the request.\n\n## Metrics-Store\n\nThis example showcases communication between a WASM filter and a service via shared queue. It combines the `Singleton-HTTP-Call` and `TCP-Metrics` examples. The filter collects metrics and enqueues it onto the queue while the service dequeues it and sends it to upstream server where it is stored.\n\nBuild and deploy:\n```bash\ncd metrics-store\nmake run-filtered\n```\n\nTest:\n```bash\ncurl 0.0.0.0:18000 -v -d \"request body\" # make a few of these calls\ncurl 0.0.0.0:8080/retrieve -v # Retrieves the stored stats\n# x | y | z  === x : downstream bytes, y : upstream bytes, z: the latency for application server to respond \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayer5io%2Fwasm-filters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flayer5io%2Fwasm-filters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayer5io%2Fwasm-filters/lists"}