Skip to content

Installation

Gerasimos (Makis) Maropoulos edited this page Oct 26, 2026 · 9 revisions

When to use this page

  • First time setting up neffos in a Go project.
  • Upgrading to a newer release.

Requirements

  • Go 1.27 or newer, see go.mod.
  • One of the three supported WebSocket adapters: gorilla, gobwas or coder. All three are pulled in transitively, you don't install them separately.

Install

go get github.com/kataras/neffos@latest

Or pin in your go.mod:

module your_project_name

go 1.27

require (
    github.com/kataras/neffos v0.0.25
)

If you're starting a new project, prefer @latest. Pin a specific version once you ship to production.

Verify the install with a one-liner:

package main

import (
    "fmt"
    _ "github.com/kataras/neffos"
)

func main() { fmt.Println("neffos installed") }

Troubleshooting

Network errors during go get usually mean GOPROXY is misconfigured. Reset to the default:

go env -w GOPROXY=https://proxy.golang.org,direct

If you're behind a corporate proxy, replace https://proxy.golang.org with your internal Go module proxy.

How to update

go get -u github.com/kataras/neffos@latest

Prefer tagged releases for production. The main branch is usually stable but may include unreleased changes, so use it only when you need a specific unreleased fix.

Browser / Node.js client

For the JavaScript/TypeScript client, see neffos.js:

npm install neffos.js

On Node.js older than 22, also install the optional ws dependency, since those versions have no built-in WebSocket global:

npm install ws

Or load the global build straight from a CDN, no npm step at all:

<script src="https://cdn.jsdelivr.net/npm/neffos.js@0.3/dist/neffos.global.min.js"></script>

Types are bundled, no separate @types/* install required.

Upgrading from v0.0.x

neffos v0.0.25 adds close codes, a heartbeat, a message size limit, Conn.Send, Server.Shutdown, a coder backend and a redis stack exchange on go-redis. It requires Go 1.27 and uses its generic methods: msg.As[T](), c.Conn.Value[T](key), c.AskObject[Reply](...), a typed Struct[T] handler, and encoding/json/v2 for message bodies. See What's new in v0.0.25 for the full list, the old-to-new API table, snippets of the new API and an old-to-new example path table.

See also

Clone this wiki locally