{"id":50706559,"url":"https://github.com/netsampler/wasm","last_synced_at":"2026-06-09T12:30:59.618Z","repository":{"id":362126243,"uuid":"1257432547","full_name":"netsampler/wasm","owner":"netsampler","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-02T19:10:01.000Z","size":384,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T20:24:23.742Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netsampler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-02T17:12:32.000Z","updated_at":"2026-06-02T19:10:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/netsampler/wasm","commit_stats":null,"previous_names":["netsampler/wasm"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/netsampler/wasm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsampler%2Fwasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsampler%2Fwasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsampler%2Fwasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsampler%2Fwasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netsampler","download_url":"https://codeload.github.com/netsampler/wasm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsampler%2Fwasm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34107865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":"2026-06-09T12:30:57.991Z","updated_at":"2026-06-09T12:30:59.610Z","avatar_url":"https://github.com/netsampler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flows WASM\n\nFlows WASM is a browser workspace for decoding, transforming, and re-encoding flow data with Go-compiled WebAssembly modules. It packages two adapters behind the same three-pane UI:\n\n- [GoFlow2](https://github.com/netsampler/goflow2) for decoding NetFlow, IPFIX, and sFlow datagrams.\n- ReFlow, from the GoFlow2 module, for browser-side flow pipeline experiments.\n\nOpen the hosted app on [GitHub Pages](https://netsampler.github.io/wasm/).\n\nThe app runs the WASM modules in a worker, renders packets with [WireView](https://github.com/radiantly/Wireview), and keeps the workflow local to the browser.\n\n## Screenshots\n\n### GoFlow2 decode workflow\n\n![GoFlow2 WASM workflow](docs/assets/goflow2-workflow.png)\n\n### ReFlow pipeline workflow\n\n![ReFlow WASM workflow](docs/assets/reflow-workflow.png)\n\n## Quick Start\n\nInstall dependencies:\n\n```sh\nnpm install\n```\n\nStart the local app:\n\n```sh\nnpm run dev\n```\n\nBuild a production bundle:\n\n```sh\nnpm run build\n```\n\nThe `dev` and `build` scripts rebuild the Go/WASM artifacts before starting Vite. The Go modules live in `apps/goflow2/wasm` and `apps/reflow/wasm`; use toolchains compatible with the `go.mod` files.\n\nUseful scripts:\n\n```sh\nnpm run build:wasm\nnpm run build:wasm:goflow2\nnpm run build:wasm:reflow\nnpm run test:wasm:goflow2\nnpm run test:wasm:reflow\n```\n\n## Workflow\n\nThe UI has three panes:\n\n1. **Input**: add samples, import captures, edit payloads, timestamps, and input types.\n2. **Config**: choose the GoFlow2 command/mapping or edit the ReFlow pipeline YAML.\n3. **Output**: inspect parsed records or raw encoded packets, then copy or download the result.\n\nUse the top-left tabs to switch between `GoFlow2` and `ReFlow`. The WASM selector shows the runtime loaded from `public/*-wasm-manifest.json`.\n\n## Import\n\nInputs are edited as entries. Each entry has a type, received timestamp, payload editor, and optional source metadata.\n\nSupported entry types by adapter:\n\n| Adapter | Types |\n| --- | --- |\n| GoFlow2 | `bytes`, `flow` |\n| ReFlow | `bytes`, `flow`, `json`, `pcap`, `pcapng` |\n\n`bytes` means slightly different things in each adapter. In GoFlow2, a bytes entry should be a complete packet carrying an IPFIX, sFlow, or NetFlow datagram, including the Ethernet + IP headers. In ReFlow, a bytes entry is just packet bytes that the browser runtime passes to the ReFlow source parser.\n\nImport options:\n\n- **Add empty** creates a new bytes entry.\n- **Presets** append built-in IPFIX, NetFlow v9, NetFlow v5, sFlow, Ethernet + IP + ICMP packet bytes, and ReFlow JSON examples.\n- **Import JSON input list** restores entries from an exported JSON file.\n- **Import PCAP as bytes** imports capture frames as raw packet bytes.\n- **Import PCAP as flow** imports flow datagrams and wraps them as synthetic UDP packets when needed for visualization.\n- **Import whole PCAP/PCAPNG** is available in ReFlow for passing a capture as one input entry.\n\nPayload editors support hex and base64 for binary inputs. JSON entries support raw JSON or a field table. The input pane can copy or download the current input list.\n\nJSON input lists can be object-based:\n\n```json\n[\n  {\n    \"type\": \"flow\",\n    \"payload\": \"AAoAJGVT8QAAAAHIAAAAAxUAAwAUAS0AAgABAJUABAAiAAQAAA==\",\n    \"receivedAt\": \"2026-06-02T04:00:00.000Z\"\n  }\n]\n```\n\nReFlow also exports and imports tuple-style inputs:\n\n```json\n[\n  [\"json\", { \"src_addr\": \"192.0.2.1\", \"dst_addr\": \"198.51.100.2\", \"bytes\": 10 }],\n  [\"flow\", \"AAoAJGVT8QAAAAHIAAAAAxUAAwAUAS0AAgABAJUABAAiAAQAAA==\", \"2026-06-02T04:00:00.000Z\"]\n]\n```\n\n## Config\n\n### GoFlow2\n\nThe GoFlow2 config pane shows the generated CLI command:\n\n```sh\ngoflow2 -listen flow://pcap -produce sample -format json\n```\n\nOutput presets change the command:\n\n| Preset | Command behavior |\n| --- | --- |\n| JSON | `-produce sample -format json` |\n| Proto | `-produce sample -format bin` |\n| Raw | `-produce raw -format json` |\n\nEnable **Use mapping.yaml** to pass the Mapping YAML editor to GoFlow2 as `-mapping mapping.yaml`. The default mapping selects common formatter fields, uses `sampler_address` as the key, renders `time_received_ns`, and maps IPFIX/NetFlow v9 field `61` to `flow_direction`.\n\nWhen the Proto preset is active, **Length-delimited protobuf** emits varint-delimited protobuf messages for tools that expect framed records.\n\n### ReFlow\n\nThe ReFlow config pane combines generated browser sections with your editable pipeline:\n\n```yaml\nsources:\n  - network: stream\n    type: json\n    json:\n      flavor: reflow\n\nprocessor:\n  type: builtin\n\naggregators:\n  - stream: flow_data\n    window:\n      idle_flush_after_ms: 60000\n    fields:\n      - key:src_addr\n      - key:dst_addr\n      - sum:bytes\n\nencoder:\n  type: json\n  json:\n    flavor: canonical\n\nsink:\n  type: stdout\n```\n\n`sources` are generated from the current input entry types. `sink` is fixed to browser stdout. The editable middle section controls the ReFlow processor, aggregators, encoder, batching, and limits.\n\nPresets can replace or append YAML sections:\n\n- Pipeline presets: flow JSON, interface IPFIX, counters sFlow, batch IPFIX.\n- Processor presets: builtin, NAT replacement, decode encap.\n- Aggregate presets: none, flow, NAT, encap, interfaces, IPFIX options, passthrough, periodic flow.\n- Encoder presets: JSON, protobuf, sFlow, IPFIX, NetFlow v5/v9, PCAP, PCAPNG, and batch settings.\n\nUse **Copy** or **Download** in the config header to export the full browser config, including generated `sources` and `sink`.\n\n## Output\n\nAfter **Run**, the output pane shows status, statistics, and records.\n\nDisplay modes:\n\n| Mode | Use |\n| --- | --- |\n| Packet | Structured record cards and packet payload cards. |\n| Raw | Plain text, hex, or base64 output for copying into other tools. |\n\nEncoding options depend on the result:\n\n- **Pretty** expands JSON or decodes protobuf payloads in a `protoc --decode_raw` style.\n- **Text** shows JSON lines or text output.\n- **Hex** shows binary output as contiguous hex or a hex dump.\n- **Base64** shows binary output as base64.\n\nCopy and download behavior:\n\n- **Copy** prefers native binary output when the browser clipboard supports it, otherwise it copies the displayed text.\n- **Download** writes native output when available, such as `.pcap`, `.pcapng`, `.ipfix`, `.sflow`, `.nfv5`, `.nfv9`, `.pb`, or `.bin`.\n- Individual packet payload cards can be downloaded separately.\n\nWireView is embedded in two places:\n\n- GoFlow2 shows an input WireView panel for the synthetic or imported capture.\n- ReFlow shows an output WireView panel when the encoder produces a PCAP-like binary capture.\n\n## Runtime Assets\n\nBuild scripts write runtime assets into `public/`:\n\n- `goflow2.wasm`\n- `reflow.wasm`\n- `wasm_exec.js`\n- `goflow2-wasm-manifest.json`\n- `reflow-wasm-manifest.json`\n- WireView assets: `wiregasm.js`, `wiregasm.wasm`, `wiregasm.bmp`, `wireshark.svg`\n\nThe manifests support multiple runtime versions. The app loads the default version and displays the selected version in the toolbar.\n\n## Project Layout\n\n```text\napps/goflow2/wasm/      GoFlow2 WASM adapter\napps/reflow/wasm/       ReFlow WASM adapter\npublic/                 WASM, manifests, worker, and WireView runtime assets\nscripts/                WASM build and asset copy scripts\nsrc/main.js             Main browser UI and adapter orchestration\nsrc/styles.css          App layout and component styling\nsrc/wireview-frame.js   Embedded WireView frame\n```\n\n## Links\n\n- [GoFlow2](https://github.com/netsampler/goflow2)\n- [WireView](https://github.com/radiantly/Wireview)\n- [Vite](https://vite.dev/)\n- [Go WebAssembly](https://go.dev/wiki/WebAssembly)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetsampler%2Fwasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetsampler%2Fwasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetsampler%2Fwasm/lists"}