Menu

chanx-go: WebSocket handlers with validation, Redis broadcasting and auto AsyncAPI docs

#golang#redditgolang#chanx#python#payload
Reading 0:00
15s threshold

Hi all, I want to share chanx-go, a Go port of chanx, the WebSocket library I built for Python (Django Channels and FastAPI). The Python version has been around since April 2025 and runs in production for me and some other people. I recently ported the whole thing to Go, keeping the same protocol, so the Go port is new and not used in production yet.

Why another WebSocket lib? Most WebSocket code I've seen, in Go or Python, ends up the same way: a read loop, a switch on a type or action field, payload checks by hand, your own hub, and no docs. So you have to read the code to know which messages a socket takes and sends back, and the client and server schemas drift apart. REST has OpenAPI and gRPC has protobuf. For WebSocket there is AsyncAPI, but few tools support it. chanx tries to fix that.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.