Supriyo Chowdhury

6 posts

Supriyo Chowdhury

Supriyo Chowdhury

@Supriyo760

GSoC'26 - Learning Unlimited

Katılım Nisan 2026
28 Takip Edilen5 Takipçiler
Vikram Aditya
Vikram Aditya@ViXkrm·
So it's been around 4 weeks since I'm working on something crazy and still haven't even marketed it which even attracted a PR from @mvanhorn yesterday I'm building uWestJS v2.0 a complete platform adapter that brings uWebSockets (one of the fastest HTTP/WS implementations) to NestJS. We're talking 3-4x faster than Express (the benchmarks say itself) while keeping all the NestJS patterns you love. Basically a deep dive into systems level web programming. What I've shipped so far: HTTP Platform: - Hybrid streaming body parser (buffers small bodies, streams large ones) - Streaming compression (gzip/brotli/deflate) with content negotiation - Static file serving with ETag, range requests, and conditional GET - CORS handler with RFC-compliant preflight validation - Multipart/form-data with streaming file uploads - Full middleware pipeline (Guards, Pipes, Filters, Interceptors) WebSocket Platform: - Room-based broadcasting with efficient message distribution - Per-message deflate compression - Automatic backpressure handling (pauses when clients are slow) - Full NestJS decorator support (@SubscribeMessage, @MessageBody, etc.) - Lifecycle hooks (onConnection, onDisconnect) - Exception filters for WebSocket errors Architecture deep dive: Memory optimizations: - Stack-allocated ArrayBuffer handling - Header caching (parse once, cache forever per request) - Parsed body caching (parse once, return cached result for subsequent calls) - Cookie parsing cache (parse on first access, cache the Map) Streaming strategies: - Hybrid body parser: 3 modes (awaiting → buffering → streaming) - Automatic mode switching based on consumption pattern - Zero-copy streaming where possible (pipe directly to destination) - Backpressure propagation (pause uWS when Node.js stream is full) - Streaming compression (compress chunks on-the-fly, no buffering) Performance patterns: - Lazy initialization (only parse what you actually use) - Referential equality for empty bodies (same object reference = zero allocations) - Efficient room management (Set-based lookups, O(1) operations) - Message queue for backpressure (buffer messages when client is slow) - Abort multiplexing (multiple handlers on single uWS abort callback) Edge case handling: - Dual rejection mechanism - Graceful degradation (skip unknown compression encodings) - Defensive programming (handle non-RFC-compliant headers) - Race condition prevention Building this taught me more about core HTTP, WebSockets, and Node.js internals than any tutorial ever could. Every feature required reading specs, understanding edge cases, and making architectural decisions about memory vs speed tradeoffs. The specs/docs rabbit hole I went down: - uWebSockets.js documentation - Understanding their zero-copy architecture, backpressure handling, and why they're so fast. Learning about their streaming model and how it differs from Node.js streams. - RFC 7230 (HTTP/1.1 Message Syntax) - Implementing proper transfer-encoding handling. Did you know chunked MUST be the final encoding? Our implementation handles non-compliant headers gracefully. - RFC 7231 (HTTP Semantics) - Building CORS preflight validation that actually follows the spec. - RFC 6265 (HTTP State Management) - Cookie parsing, serialization, and security. Implementing signed cookies, httpOnly flags, and SameSite attributes correctly. - RFC 1952 (GZIP) & RFC 7932 (Brotli) - For streaming compression. We compress responses on-the-fly without buffering - crucial for large payloads. - Express.js source code - Spent days understanding their middleware patterns, body parsing, and error handling to maintain API compatibility. Your Express code should just work. - NestJS docs and adapter contracts - Deep dive into AbstractHttpAdapter, AbstractWsAdapter, ModuleRef, and the entire DI system. Understanding how Guards, Pipes, and Filters get resolved and executed. - Socket.IO internals - Replicating their room management and broadcasting API. Understanding how they handle namespaces, acknowledgments, and connection lifecycle. - Busboy documentation - Implementing RFC-compliant multipart/form-data parsing with streaming file uploads and proper backpressure handling. Launching v2.0 on NPM and publicly soon. GitHub: github.com/FOSSFORGE/uWes…
Vikram Aditya tweet mediaVikram Aditya tweet mediaVikram Aditya tweet media
English
3
12
45
1.6K
Ankit Sisodya
Ankit Sisodya@Ankit_Sisodya·
I am tired of people on tech twitter saying GSoC is not possible in 3rd yr Just take a look at our numbers :)
Ankit Sisodya tweet media
English
17
3
84
5.1K
Raj
Raj@raj_av9·
Selected for GSoC. No noise, just shipped. 🚀 Thanks to all the folks of @OpenMRS for the help throughout this journey and @kirat_tw for such crazy contents
Raj tweet media
English
26
6
210
5.2K