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.UpgraderCompare: Node.js · Standard Go · gox
js
// Typical ws pattern in Node.jsgo
// gorilla/websocket Upgrader or Dialergo
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.