Categorygithub.com/relaytools/go-wsstat
repositorypackage
0.0.0-20240624222222-831694dc7443
Repository: https://github.com/relaytools/go-wsstat.git
Documentation: pkg.go.dev

# README

go-wsstat Go Documentation MIT License

Use the go-wsstat Golang package to trace WebSocket connection and latency in your Go applications. It wraps the gorilla/websocket package for the WebSocket protocol implementation, and measures the duration of the different phases of the connection cycle. The program takes inspiration from the go-httpstat package, which is useful for tracing HTTP requests.

Install

The package is built on Go 1.21 but it has been tested to work with Go 1.18, in case that is of interest. Install to use in your project with go get:

go get github.com/jakobilobi/go-wsstat

Usage

The _example/main.go program demonstrates how to use the go-wsstat package to trace a WebSocket connection.

Run the example:

go run _example/main.go <a WebSocket URL>

Run the tests:

make test