Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akhenakh/wasm-filter-go
experiments with WASM Envoy and Go
https://github.com/akhenakh/wasm-filter-go
Last synced: 24 days ago
JSON representation
experiments with WASM Envoy and Go
- Host: GitHub
- URL: https://github.com/akhenakh/wasm-filter-go
- Owner: akhenakh
- Created: 2024-07-19T01:16:51.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-26T17:39:29.000Z (3 months ago)
- Last Synced: 2024-09-14T04:38:29.268Z (about 2 months ago)
- Language: Go
- Size: 239 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WASM go Filter for Envoy
## Build
```
tinygo build -o plugin.wasm -scheduler=none -target=wasi ./main.go
```
## Testing```
envoy -c ./envoy.yaml --concurrency 2 --log-format '%v'
```
## Optimization GCMemory leaks exist in the Wasm plug-in for an Envoy proxy compiled by using TinyGo. The proxy-wasm-go-sdk community recommends that you use nottinygc for compilation optimization. Perform the following steps to use nottinygc for compilation optimization:
Add the following import code to the beginning of the main.go file:
```go
import _ "github.com/wasilibs/nottinygc"
```If no dependencies are found, you can run the go mod tidy command to automatically download the dependencies.
Run the following command to compile the code:
```sh
tinygo build -o plugin.wasm -gc=custom -tags='custommalloc nottinygc_envoy' -target=wasi -scheduler=none main.go
```The preceding command sets the -gc and -tags parameters. For more information, see nottinygc.