{"id":49524357,"url":"https://github.com/uesleibros/wasabi","last_synced_at":"2026-05-05T06:05:30.338Z","repository":{"id":354929350,"uuid":"1225203687","full_name":"uesleibros/wasabi","owner":"uesleibros","description":"A pure-VBA WebSocket/WSS client powered by Winsock, Schannel, and native Windows APIs.","archived":false,"fork":false,"pushed_at":"2026-05-01T00:00:34.000Z","size":371,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-01T02:05:47.869Z","etag":null,"topics":["excel","office","proxy","real-time","schannel","socket","ssl","tcp","tls","vba","websocket","win32","winsock","wss"],"latest_commit_sha":null,"homepage":"","language":"VBA","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/uesleibros.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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-04-30T03:42:09.000Z","updated_at":"2026-05-01T00:00:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/uesleibros/wasabi","commit_stats":null,"previous_names":["uesleibros/wasabi"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/uesleibros/wasabi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uesleibros%2Fwasabi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uesleibros%2Fwasabi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uesleibros%2Fwasabi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uesleibros%2Fwasabi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uesleibros","download_url":"https://codeload.github.com/uesleibros/wasabi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uesleibros%2Fwasabi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32520156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"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":["excel","office","proxy","real-time","schannel","socket","ssl","tcp","tls","vba","websocket","win32","winsock","wss"],"created_at":"2026-05-02T02:00:53.234Z","updated_at":"2026-05-02T02:00:57.883Z","avatar_url":"https://github.com/uesleibros.png","language":"VBA","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"resources/logo.png\" width=\"150\" /\u003e\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003eWasabi\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  Production-ready WebSocket and WSS for VBA with native TLS, auto reconnect, proxy support, MQTT, permessage-deflate, and zero external dependencies\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"License\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/platform-Windows-0078D6.svg\" alt=\"Platform\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/language-VBA-867DB1.svg\" alt=\"Language\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/architecture-32%20%26%2064--bit-green.svg\" alt=\"Architecture\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/TLS-1.2%20%2F%201.3-brightgreen.svg\" alt=\"TLS\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/dependencies-none-success.svg\" alt=\"Dependencies\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/WebSocket-RFC%206455-orange.svg\" alt=\"WebSocket\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Proxy-HTTP%20%2B%20SOCKS5-yellowgreen\" alt=\"Proxy\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/mTLS-PFX%20%2B%20Store-yellow\" alt=\"mTLS\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/MQTT-3.1.1%20over%20WS-purple\" alt=\"MQTT\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Proxy%20Auth-NTLM%2FKerberos-red\" alt=\"NTLM\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/revocation-CRL%2FOCSP-lightgrey\" alt=\"Revocation\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/HTTP%2F2-ALPN%20negotiation-blue\" alt=\"HTTP/2\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/RTT-latency%20measurement-orange\" alt=\"RTT\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Deflate-permessage--deflate-success\" alt=\"Deflate\" /\u003e\n  \u003cimg src=\"https://img.shields.io/github/stars/uesleibros/wasabi?style=flat\u0026color=gold\" alt=\"Stars\" /\u003e\n  \u003cimg src=\"https://img.shields.io/github/last-commit/uesleibros/wasabi?style=flat\" alt=\"Last Commit\" /\u003e\n\u003c/p\u003e\n\n## What is Wasabi\n\nWasabi is a VBA module designed to make WebSocket communication simple, predictable, and practical — bringing an experience similar to [socket.io](https://socket.io) in Node.js, but entirely within the Office ecosystem. It is a single, self-contained `.bas` file that compiles seamlessly on 32-bit and 64-bit Office hosts, from Windows XP to Windows 11.\n\nBeyond basic WebSocket messaging, Wasabi bundles an MQTT 3.1.1 client, NTLM/Kerberos proxy authentication, RTT latency measurement, fine-grained TLS certificate control, and `permessage-deflate` compression (RFC 7692) — all without mandatory external dependencies.\n\n## Roadmap\n\n- [x] IPv6 and SNI support\n- [x] Mutual TLS (mTLS) for client certificate authentication\n- [x] SOCKS5 proxy support\n- [x] HTTP/2 upgrade via ALPN (opt-in)\n- [x] NTLM/Kerberos authentication for HTTP proxies\n- [x] MQTT 3.1.1 client over WebSocket (publish, subscribe, receive)\n- [x] RTT latency measurement (GetLatency)\n- [x] permessage-deflate compression (RFC 7692)\n- [ ] I/O Completion Ports (IOCP) for kernel-driven socket monitoring\n- [x] Zero-copy receive buffers\n- [x] MTU-aware frame sizing\n- [x] Send batching (text and binary)\n- [x] Close frame payload parsing\n- [x] Happy Eyeballs (RFC 6555)\n- [x] Configurable CRL/OCSP certificate revocation checking\n- [ ] `WSAAsyncSelect` event-driven socket notifications\n- [ ] `WebSocketStartListening` helper for one-line polling loops\n\n## Why Wasabi exists\n\nVBA is excellent for automation and integration with Excel, PowerPoint, Word and other Office applications, but it hits a wall when real-time communication is required. In practice, anyone trying to build a project that depends on live messaging usually runs into three problems:\n\n- **No standardization:** there is no official, modern path for sockets and WebSockets in VBA.\n- **Verbose low-level APIs:** the most common options require a lot of infrastructure code just to connect and maintain a stable session.\n- **Limited event-driven patterns:** it is common to end up with loops, timers and control logic just to simulate something that other languages handle natively.\n\n## What VBA limitations it solves\n\nWorking with networking in VBA often becomes a project of its own. Some typical pain points:\n\n**Winsock and Windows API calls**\n- Require declarations, structs, callbacks and low-level details unrelated to the actual goal.\n- Small adjustments can break compatibility or introduce hard-to-track bugs.\n\n**Security and randomness**\n- WebSocket connections require cryptographically secure XOR masks to protect against proxy cache poisoning attacks.\n- VBA's built-in `Rnd` function is deterministic and unsuitable for this purpose.\n- Wasabi uses `CryptGenRandom` from `advapi32.dll` for all WebSocket frame masks, falling back to `Rnd` only in the extraordinary case that the cryptographic API is unavailable.\n\n**HTTP is not WebSocket**\n- Even with WinHTTP or MSXML, you are in a request/response world.\n- Real-time scenarios turn into polling, long-polling or workarounds that consume resources and increase latency.\n\n**Limited asynchronism**\n- VBA was not designed for modern concurrency.\n- Without a good abstraction, it is easy to freeze the UI or create inconsistent state.\n\n**No built-in MQTT, NTLM, or latency measurement**\n- IoT integration, corporate proxy authentication, and network diagnostics are common requirements that have no standard VBA solution.\n- Wasabi provides all three out of the box: `MqttConnect`, `WebSocketSetProxyNtlm`, and `WebSocketGetLatency`.\n\n**Maintenance and readability**\n- Most handcrafted solutions grow long and fragile.\n- The networking layer becomes the largest part of the project, making simple things hard to maintain.\n\n## Where it is useful\n\n- **Bots** (Discord, Slack, Telegram), connect to gateways and handle real-time events and messages directly from Excel or Word\n- **Trading and finance**, stream live prices from exchanges like Binance, Coinbase or B3 into spreadsheet cells with millisecond-level latency\n- **Dashboards**, update live data on a spreadsheet without manual refresh or polling HTTP endpoints\n- **IoT and industrial**, receive sensor data from ESP32, Raspberry Pi or SCADA systems via WebSocket or MQTT directly into Office\n- **Games and interactive tools**, build client/server communication for VBA-based games or collaborative tools\n- **Corporate automation**, connect Office to internal WebSocket APIs behind proxies and firewalls without installing anything\n\n## Quick Start\n\n\u003e [!NOTE]\n\u003e Before using Wasabi, it is highly recommended that you review the [documentation](docs).\n\n### Import\n\n[Download the latest version of Wasabi](../../releases) and import it into your VBA project via\n**File → Import File** in the VBA editor.\n\nNo references need to be enabled in **Tools → References**.\n\n\u003e For the complete reference with examples, parameters, return values, and usage\nnotes, see [API Reference](docs/API_REFERENCE.md).\n\n## Compatibility\n\nWasabi was designed to run without any external dependencies, using exclusively\nnative Windows DLLs that ship with every version of Windows. No references need\nto be enabled in **Tools → References**, no COM components need to be registered,\nand no third-party installers are required. Dropping the `.bas` file into a VBA\nproject is all it takes.\n\n### Operating System\n\n| Version | Support |\n|---|---|\n| Windows XP | ✅ |\n| Windows Vista | ✅ |\n| Windows 7 | ✅ |\n| Windows 8 / 8.1 | ✅ |\n| Windows 10 | ✅ |\n| Windows 11 | ✅ |\n\nWasabi relies on `ws2_32.dll`, `secur32.dll`, `kernel32.dll`, `advapi32.dll`, and\n`crypt32.dll`. These libraries are present in every version of Windows since XP,\nwhich is why Wasabi runs on machines over 20 years old without modifications.\n\nThis is a deliberate architectural choice. Many competing modules depend on the\n`WinHttpWebSocket*` family of functions (`WinHttpWebSocketSend`,\n`WinHttpWebSocketReceive`, `WinHttpWebSocketCompleteUpgrade`) introduced only in\nWindows 8. As a result, those modules silently fail on Windows 7 machines, which\nremain common in corporate and industrial environments. Wasabi has no such\nlimitation.\n\n### Office and VBA\n\n| Environment | Support |\n|---|---|\n| Excel 32-bit | ✅ |\n| Excel 64-bit | ✅ |\n| Word 32-bit | ✅ |\n| Word 64-bit | ✅ |\n| PowerPoint 32-bit | ✅ |\n| PowerPoint 64-bit | ✅ |\n| Access 32-bit | ✅ |\n| Access 64-bit | ✅ |\n| Any VBA7 host (Office 2010+) | ✅ |\n| VBA6 (Office 2007 and earlier) | ✅ |\n\nThe transition from 32-bit to 64-bit Office broke many VBA modules that used\nnative API declarations. Wasabi handles this transparently through conditional\ncompilation.\n\nEvery API declaration uses `#If VBA7` to switch between `Long` (32-bit) and\n`LongPtr`/`PtrSafe` (64-bit). The same `.bas` file works correctly on Office\n2007 32-bit and Office 365 64-bit on Windows 11.\n\n\u003e 32-bit and 64-bit compatibility is guaranteed through conditional compilation (`#If VBA7`) across all API declarations.\n\n### Native DLLs\n\n| Library | Role in Wasabi | Optional |\n|---|---|---|\n| `ws2_32.dll` | TCP socket creation, DNS, send/recv | No |\n| `secur32.dll` | TLS 1.2/1.3 via Schannel SSPI | No |\n| `kernel32.dll` | Memory operations, UTF-8, tick count | No |\n| `advapi32.dll` | Cryptographic random numbers (`CryptGenRandom`) | No |\n| `crypt32.dll` | Certificate store, chain validation | No |\n| `zlib1.dll` | Compression for `permessage-deflate` | **Yes** |\n\n**ws2_32.dll (Windows Sockets 2)**\nCore networking. Creates TCP sockets, resolves hostnames, sends and receives raw\nbytes. Direct use avoids performance and flexibility limitations of WinHTTP.\n\n**secur32.dll (Security Support Provider Interface)**\nWindows security library for TLS. Wasabi performs the full TLS handshake via\n`AcquireCredentialsHandle` and `InitializeSecurityContext`, then encrypts/decrypts\nvia `EncryptMessage` and `DecryptMessage`. This gives complete control over TLS\nflags, protocol versions, and cipher negotiation.\n\n**kernel32.dll**\n`RtlMoveMemory` for buffer manipulation, `MultiByteToWideChar`/`WideCharToMultiByte`\nfor UTF-8, and `GetTickCount` for timeouts with wraparound handling.\n\n**advapi32.dll**\n`CryptGenRandom` for cryptographically secure random bytes used in WebSocket frame\nmasks. Falls back to `Rnd` only if the cryptographic API is unavailable.\n\n**crypt32.dll**\nPFX import, certificate store search, chain building, and server certificate\nvalidation. Same library used by Internet Explorer and Edge.\n\n**zlib1.dll (optional)**\nRequired only when `permessage-deflate` compression is enabled via\n`WebSocketConnect(url, handle, True)`. Wasabi searches for `zlib1_x64.dll` or\n`zlib1_x86.dll` in the project folder and several subdirectories. If not found,\ncompression is silently disabled and the connection proceeds normally. See\n[DEFLATE.md](docs/DEFLATE.md) for details.\n\n### What does \"zero external dependencies\" mean in practice\n\nWasabi requires nothing beyond Windows and the VBA runtime.\n\nNo installer, no COM registration, no ActiveX control, no third-party DLL, no\nPython runtime, no .NET package, no `regsvr32`. Just import the `.bas` file.\n\nThe only optional component is `zlib1.dll`, needed only if you enable\n`permessage-deflate`. The module detects its presence automatically and works\nperfectly without it.\n\nThis matters in corporate environments where IT policies prevent software\ninstallation. You can distribute a workbook containing Wasabi without asking\nthe user to install anything first.\n\n## Compression (permessage-deflate)\n\nWasabi supports the WebSocket `permessage-deflate` extension (RFC 7692), which\ncompresses message payloads to reduce bandwidth usage.\n\n- Compression is **opt-in** on a per‑connection basis\n- Requires `zlib1.dll` (see [Native DLLs](#native-dlls) and [DEFLATE.md](docs/DEFLATE.md))\n- Automatically negotiates with the server during handshake\n- Falls back gracefully if the server doesn't support compression or the DLL is missing\n\n```vb\n' Connect with compression enabled\nIf WebSocketConnect(\"wss://example.com/ws\", h, True, True) Then\n    Debug.Print \"Compression active:\", WebSocketGetDeflateEnabled(h)\nEnd If\n```\n\n\u003e [!NOTE]\n\u003e `permessage-deflate` reduces bandwidth, not latency. It's most beneficial for\n\u003e large payloads or connections with limited bandwidth. For small messages, the\n\u003e CPU overhead may slightly outweigh the bandwidth savings.\n\n## Execution Model: Single-Thread and Polling\n\nVBA is single-threaded. One execution thread is shared between your code and\nthe Office interface, so there is no native background socket listening.\n\nWasabi uses a polling model: incoming messages accumulate in internal buffers\nand are delivered when you call `WebSocketReceive`.\n\nEach `WebSocketReceive` call:\n1. Runs maintenance (pings, inactivity timeout, MTU probes)\n2. Checks the OS socket buffer (`FIONREAD`)\n3. Reads available data\n4. Decrypts (if TLS) and parses WebSocket frames\n5. Returns the oldest queued message\n\nBetween calls, the socket stays open and the kernel buffers incoming data.\nNo messages are lost.\n\n- **Not slow.** The ring buffer holds up to 512 messages.\n- **Connection doesn't drop.** The socket stays active regardless of polling frequency.\n- **No infinite loop required.** Simple send/receive/disconnect workflows work fine.\n\n## Acknowledgements\n\nWasabi was built on years of community efforts to bring real-time networking\nto the Office ecosystem.\n\n- [**WinHttpWebSocket**](https://github.com/EagleAglow/vba-websocket) — first serious WebSocket attempt in VBA using native APIs\n- [**VbAsyncSocket**](https://github.com/wqweto/VbAsyncSocket) — the most sophisticated VB6/VBA networking library, with native Schannel\n- [**VBA-Web**](https://github.com/VBA-tools/VBA-Web) — standard for HTTP/REST communication in VBA\n- [**TlsSocketWSS**](https://github.com/Maatooh/TlsSocketWSS-vb6) — TLS WebSocket server for VB6\n- [**VB6-WebSocket-Server-SSL**](https://github.com/JoshyFrancis/vb6-websocket-server-ssl) — pure VB6 secure WebSocket server\n- [**VBA_WinSockAPI**](https://github.com/papanda925/VBA_WinsockAPI_TCP_Sample) — educational Winsock TCP client/server in VBA\n\nThese projects shaped every architectural decision in Wasabi: the non-blocking\nI/O model, manual Schannel, ring buffers, and auto-reconnect.\n\nThe VBA community is smaller than it deserves to be. Anyone building open source\nin this ecosystem is doing genuinely valuable work. Wasabi stands on their shoulders.\n\n## Contributing\n\nBug reports, feature requests, and pull requests are welcome. See\n[CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Security\n\nDo **not** report vulnerabilities through public issues. See\n[SECURITY.md](SECURITY.md) and use GitHub Private Vulnerability Reporting.\n\n## License\n\n**MIT**, free for personal and commercial use. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuesleibros%2Fwasabi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuesleibros%2Fwasabi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuesleibros%2Fwasabi/lists"}