{"id":17179645,"url":"https://github.com/maxmcd/wasabi-archive","last_synced_at":"2025-04-13T17:12:24.322Z","repository":{"id":37888867,"uuid":"190817791","full_name":"maxmcd/wasabi-archive","owner":"maxmcd","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-14T16:11:10.000Z","size":4005,"stargazers_count":5,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T14:48:05.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/maxmcd.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":"2019-06-07T22:28:45.000Z","updated_at":"2023-10-13T12:35:46.000Z","dependencies_parsed_at":"2024-06-19T13:34:37.573Z","dependency_job_id":"4a2bb685-142f-425b-86e9-2ea1cb6282a6","html_url":"https://github.com/maxmcd/wasabi-archive","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmcd%2Fwasabi-archive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmcd%2Fwasabi-archive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmcd%2Fwasabi-archive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmcd%2Fwasabi-archive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxmcd","download_url":"https://codeload.github.com/maxmcd/wasabi-archive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248750126,"owners_count":21155687,"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-15T00:27:03.861Z","updated_at":"2025-04-13T17:12:24.296Z","avatar_url":"https://github.com/maxmcd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wasabi\n\nA webassembly runtime designed for multitenancy\n\nWasabi is a webassembly runtime built using [Cranelift](https://github.com/cranestation/cranelift) and [Wasmtime](https://github.com/cranestation/wasmtime).\n\nCurrently Wasabi runs Go programs compiled to webassembly and provides some access to underlying system resources. Go wasm programs rely on the browser context and [this execution file](https://github.com/golang/go/blob/release-branch.go1.12/misc/wasm/wasm_exec.js). Wasabi mocks out (almost) all of the functionality in this file with a few caveats:\n\n - No Go standard library networking functionality is supported. Limited networking is provided by [a separate library](https://godoc.org/github.com/maxmcd/wasabi)\n - A handful of wasm_exec.js functions are not supported and it is generally not suggested to use the syscall/js library\n\nWasabi is very rough around the edges. Don't expect it to work very well and please open an issue if you experience any bugs. \n\n## Go Example\n\nThere is a simple go program [here](./programs/go-net-example/main.go) that runs an http server and makes 1000 requests to itself before exiting. Here are some of the relevant bits from that file:\n\n```go\n\n// import the wasabi library\nimport \"github.com/maxmcd/wasabi\"\n\n// This is how you would replace http.Get. It's required to pass the Wasabi\n// transport to the http client\nfunc httpGet(url string) (*http.Response, error) {\n    client := http.Client{Transport: \u0026wasabi.RoundTripper{}}\n    req, err := http.NewRequest(\"GET\", url, nil)\n    if err != nil {\n        return nil, err\n    }\n    return client.Do(req)\n}\n// Wasabi provides a replacement for http.ListenAndServe\nlog.Fatal(wasabi.ListenAndServe(\"127.0.0.1:8080\", handler))\n```\n\nCompile this program into a wasm binary. **Only Go 1.12 is supported** \n\n```bash\nGOOS=js GOARCH=wasm go build -o go-net-example.wasm\n```\n\ncd into ./wasabi and run the following to build and run wasabi\n\n```bash\ncargo +nightly run --release -- ../programs/go-net-example/go-net-example.wasm\n```\n\nThe server should then spin up and you should see the logging output from the requests.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxmcd%2Fwasabi-archive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxmcd%2Fwasabi-archive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxmcd%2Fwasabi-archive/lists"}