{"id":17135796,"url":"https://github.com/brendandburns/caddy-wasm","last_synced_at":"2025-04-15T04:03:42.418Z","repository":{"id":189971366,"uuid":"681687605","full_name":"brendandburns/caddy-wasm","owner":"brendandburns","description":"WebAssembly (WASM) extension for the caddy2 web server.","archived":false,"fork":false,"pushed_at":"2024-08-22T23:35:11.000Z","size":138,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-15T20:02:18.928Z","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/brendandburns.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":"2023-08-22T14:39:27.000Z","updated_at":"2024-10-14T14:50:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"12949583-c187-46ba-90d1-a07e0d8aadbf","html_url":"https://github.com/brendandburns/caddy-wasm","commit_stats":null,"previous_names":["brendandburns/caddy-wasm"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendandburns%2Fcaddy-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendandburns%2Fcaddy-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendandburns%2Fcaddy-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendandburns%2Fcaddy-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brendandburns","download_url":"https://codeload.github.com/brendandburns/caddy-wasm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224901310,"owners_count":17388950,"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":[],"created_at":"2024-10-14T20:01:02.825Z","updated_at":"2024-11-16T10:08:37.310Z","avatar_url":"https://github.com/brendandburns.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# WebAssembly extension for Caddy\nThis is a very experimental work in progress, use at your own risk!\n\nPRs welcome!\n\n## Running\n```sh\nxcaddy run --config caddy.json\ncurl localhost:2015\n```\n\n## Building WASM modules\nThe server uses the [WASI-HTTP](https://github.com/WebAssembly/wasi-http) specification.\n\nThere are examples here:\n* Go (TinyGo) - https://github.com/brendandburns/caddy-wasm/tree/main/examples/tinygo\n* C - https://github.com/brendandburns/caddy-wasm/tree/main/examples/c\n* Dotnet - https://github.com/dev-wasm/dev-wasm-dotnet/blob/main/www-wasi/Program.cs\n\nMore to come in the future!\n\n## Version loading\nThe wasm loader supports loading multiple versions of the same functionality and then chosing between them using a header.\n\nTo see this in action run:\n```sh\n# Run caddy pointed at the releases at https://github.com/brendandburns/caddy-wasm/releases\n$ xcaddy run --config examples/github-versions.json\n# Get the default version\n$ curl localhost:2015\nThis is the beta release!\n# Select a version\n$ curl -H \"x-caddy-wasm-version: 0.0.1\" localhost:2015\nThis is the alpha release!\n```\n\nThe specific configuration for this looks like:\n```json\n{\n    \"handle\": [{\n        \"handler\": \"wasm\",\n        \"wasm_file\": \"tinygo.wasm\",\n        \"wasm_github\": \"brendandburns/caddy-wasm\"\n    }]\n}\n```\nThe `wasm_file` directive specifies the file to look for in the release assets, releases without that file will be skipped.\nThe `wasm_github` directive points to the repository where the releases are contained.\n\n### Other version loaders\nCurrently there is also a glob loader that supports loading all files that match a glob:\n```json\n{\n    \"handle\": [{\n        \"handler\": \"wasm\",\n        \"wasm_file\": \"test/*.wasm\"\n    }]\n}\n```\n\nAll files matching the glob (from the working directory where `caddy` is launched) will be served.\nTheir \"version\" is the complete file path that matches the glob.\n\n## Bugs/Features\nI'm sure there are many, please feel free to file issues.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrendandburns%2Fcaddy-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrendandburns%2Fcaddy-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrendandburns%2Fcaddy-wasm/lists"}