Last updated

🔗💥 powpow

A high-performance event notification library for Nim. powpow provides a low-level event loop and timer wheel, plus higher-level abstractions for building TCP, UDP, HTTP/1.1, WebSocket and multi-threaded servers — built on top of epoll (Linux), kqueue (BSD, macOS) and IOCP (Windows), with an opt-in Linux io_uring backend.

nimble install powpow

🔗Key features

  • Event loop — single-threaded reactor, 4-level timer wheel, deferred/idle hooks, thread-safe postToLoop
  • TCP & UDP — non-blocking servers and clients, connection pooling, zero-copy sendfile, Unix domain sockets
  • HTTP/1.1 — incremental zero-copy parser, chunked and streaming bodies, multipart uploads, static file serving with Range support
  • WebSocket — RFC 6455, standalone and HTTP-upgrade modes
  • TLS — OpenSSL, implicit and STARTTLS-style upgrades
  • Async DNS — in-loop resolver, no blocking getaddrinfo
  • Streams — raw-fd I/O (IoStream): pipes, subprocess stdout, socketpair IPC, with read backpressure
  • Multi-threaded — SO_REUSEPORT workers, one event loop per core
  • SIMD — SSE2-accelerated HTTP message scanning
  • io_uring — opt-in Linux submission-based backend with zero-copy send_zc, SPLICE file sends and registered buffers (guide)

🔗Getting started

Overview

What powpow is, its design philosophy, architecture and the complete feature matrix.

Getting started

Install powpow, write your first HTTP and WebSocket server, and learn the build flags and conventions.

Examples

Every runnable powpow example, each with full source and a walkthrough: HTTP, WebSocket, TCP, UDP, DTLS, TLS, UDS, clients, timers, signals and rate limiting.

🔗Guides

Event loop

The powpow Loop: timers, deferred and idle hooks, fd events, observers, buffer pooling, and the platform backends.

TCP

Non-blocking TCP servers and clients on the powpow loop: connection pooling, corking, sendv, zero-copy file send and graceful shutdown.

HTTP server

The powpow HTTP/1.1 server: handlers, the fluent response builder, configuration fields, and bring-your-own-router design.

WebSocket

RFC 6455 WebSocket in powpow: standalone servers, HTTP-upgrade endpoints, and a self-managed client with auto-reconnect, wss:// support and sendMessage.

io_uring

The opt-in Linux io_uring backend: submission-based I/O, zero-copy send_zc, splice file sends, registered buffers and the full io_uring API binding.

🔗Reference

@api/README.md

Security

powpow's security hardening: timeouts, bounded buffering, upload caps, static-file safety, and the recommended production configuration.

Performance

powpow's performance mechanisms — SIMD, pooling, zero-copy, timer wheel — plus the dummy benchmarks.

Testing

The powpow test suite: how to run it, the test-suite map, and the smuggler fuzz configs.