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

Upgrader

Overview ​

Upgrader upgrades HTTP connections to WebSocket.

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

Upgrader is a type exported by gox. Methods on this type are documented separately.

Signature ​

go
type Upgrader = websocket.Upgrader

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"

upgrader := ws.Upgrader{CheckOrigin: func(r *http.Request) bool { return true }}

Example ​

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

upgrader := ws.Upgrader{CheckOrigin: func(r *http.Request) bool { return true }}

Tips ​

Browse methods on this type in the sidebar for handler-style APIs and options structs.

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