Go - NewWebsocket()
This is reference documentation for the Nitric Go SDK. To learn about Websockets in Nitric start with the Websockets docs.
Creates a new Websocket.
import ("github.com/nitrictech/go-sdk/nitric")func main() {ws := nitric.NewWebsocket("public")nitric.Run()}
Parameters
- Name
name- Required
- Required
- Type
- string
- Description
The unique name of this Websocket within the app. Subsequent calls to
NewWebsocketwith the same name will return the same object.
Examples
Create a Websocket
import ("github.com/nitrictech/go-sdk/nitric")func main() {ws := nitric.NewWebsocket("public")nitric.Run()}
Have feedback on this page?
Open GitHub IssueLast updated on Oct 7, 2025