Skip to content
Node: wsgithub.com/sahilkhaire/gox/ws

DefaultUpgrader

Overview

DefaultUpgrader allows all origins (suitable for tests; tighten in production).

Part of the ws package — Node.js analog: ws.

Use this constant or variable directly — no function call required.

Signature

go
var DefaultUpgrader

Compare: Node.js · Standard Go · gox

js
// Typical ws pattern in Node.js
go
// gorilla/websocket Upgrader or Dialer
go
import "github.com/sahilkhaire/gox/ws"

conn, err := ws.DefaultUpgrader.Upgrade(w, r, nil)

Example

go
import "github.com/sahilkhaire/gox/ws"

conn, err := ws.DefaultUpgrader.Upgrade(w, r, nil)

Standard library alternative

gox wraps the Go standard library or a trusted dependency with Node-familiar naming. You can use the underlying library directly — see the package overview for escape hatches.

Back to ws package overview

MIT Licensed · Built for Node.js developers moving to Go