Show HN: GoSocket – A Simple WebSocket Framework for Go

2 filipejohansson 0 9/8/2025, 1:00:59 AM github.com ↗
Hi HN,

I built GoSocket, a small library that helps you set up WebSocket servers in Go with almost no boilerplate.

It lets you start a server in a few lines of code, handle connections, broadcast to rooms or clients, and add middleware. JSON is supported now, Protobuf and MessagePack are planned.

Example:

ws := gosocket.NewServer() ws.WithPort(8080). WithPath("/ws"). OnMessage(func(c gosocket.Client, m gosocket.Message, ctx *gosocket.HandlerContext) error { c.Send(m.RawData) // echo return nil }) log.Fatal(ws.Start())

Repo: https://github.com/FilipeJohansson/gosocket

It’s still pre-1.0, so I’d love feedback, testing, and contributions.

Comments (0)

No comments yet