{"id":23554512,"url":"https://github.com/darkweak/wazemmes","last_synced_at":"2025-09-03T08:14:34.168Z","repository":{"id":268977759,"uuid":"879047378","full_name":"darkweak/wazemmes","owner":"darkweak","description":"Wasm HTTP middleware, agnostic, efficient and blazing fast.","archived":false,"fork":false,"pushed_at":"2024-12-17T17:33:02.000Z","size":41,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-08-27T09:42:11.324Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darkweak.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-26T20:22:56.000Z","updated_at":"2025-01-12T18:28:57.000Z","dependencies_parsed_at":"2024-12-20T05:13:49.376Z","dependency_job_id":"d9fa22d3-ea21-426c-9dc1-a0c9737961a4","html_url":"https://github.com/darkweak/wazemmes","commit_stats":null,"previous_names":["darkweak/wazemmes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/darkweak/wazemmes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkweak%2Fwazemmes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkweak%2Fwazemmes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkweak%2Fwazemmes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkweak%2Fwazemmes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darkweak","download_url":"https://codeload.github.com/darkweak/wazemmes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkweak%2Fwazemmes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273410529,"owners_count":25100538,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-12-26T12:15:40.328Z","updated_at":"2025-09-03T08:14:34.131Z","avatar_url":"https://github.com/darkweak.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WAZEMMES\n\n## What is this project?\nWe needed a WASM module for Caddy and made it proxy agnostic, so you can use it as an HTTP middleware in your projects.\n\n## How to build\nMake sure you have already installed:\n* go\n* tinygo\n* xcaddy\nAfter all requirements done, just run\n```\nmake build caddy run-caddy\n```\n\nExplanations:\n* `build`: compile the demo WASM plugin (located in the `wasm` directory)\n* `caddy`: compile a new caddy instance using xcaddy\n* `run-caddy`: run your fresh caddy instance\n\n## Caddyfile\nYou have to tell to your instance to use the WASM middleware in the Caddyfile. To do that, you can take your inspiration from this [Caddyfile](/darkweak/wazemmes/tree/master/caddy/Caddyfile):\n```\nlocalhost {\n    wasm {\n        item {\n            filepath ../relative/plugin.wasm\n            configuration {\n                # The configuration your WASM plugin expects.\n                body_response \"Bonjour! 🥖\"\n            }\n        }\n        item {\n            filepath /another/path/to/your.wasm\n            configuration {\n                # The configuration your WASM plugin expects.\n                body_response \"Hello middleware!\"\n            }\n        }\n    }\n\n    respond \"Hello world!\"\n}\n```\n\n## Configuration\nThis module allows you to chain multiple middlewares, you just have to define one or more `item` in the Caddyfile. For each `item` you have to pass the `filepath` that is the path to the compiled WASM plugin, and a configuration that is a free shape.\n```\nwasm {\n    item {\n        filepath first.wasm\n        configuration {\n            my_key my_value\n        }\n    }\n    item {\n        filepath second.wasm\n    }\n}\n```\n\nUnder the hood, this middleware uses a pool to be memory efficient and you are able to configure it through the Caddyfile using the `pool` directive. Refers to the [configuration from github.com/jolestar/go-commons-pool](https://github.com/jolestar/go-commons-pool?tab=readme-ov-file#pool-configuration-option) to learn more about the keys.\n```\nwasm {\n    pool {\n        LIFO false\n        TestOnCreate false\n        TestOnBorrow false\n        TestOnReturn false\n        TestWhileIdle false\n        BlockWhenExhausted false\n        MaxTotal 1000\n        MaxIdle 1000\n        MinIdle 1000\n        NumTestsPerEvictionRun 1000\n        MinEvictableIdleTime 10s\n        SoftMinEvictableIdleTime 10s\n        TimeBetweenEvictionRuns 10s\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkweak%2Fwazemmes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkweak%2Fwazemmes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkweak%2Fwazemmes/lists"}