# gows **Repository Path**: cuberl/gows ## Basic Information - **Project Name**: gows - **Description**: a simple implement of websocket written in go - **Primary Language**: Go - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-03-19 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gows a simple implement of websocket written in go ## Install ``` go get gitee.com/cuberl/gows ``` ## Usage ```go import ( "fmt" "io" "gitee.com/cuberl/gows" ) func main() { gows.New("localhost", 8091, func(conn *gows.Conn) { conn.Ping(30, func(conn *gows.Conn) { fmt.Println("ping timeout.") }) for { data, err := conn.Read() if err != nil { if err == io.EOF { fmt.Println("Connection Close.") } else { fmt.Println(err) } break } fmt.Fprintf(conn, "hello, %s\n", string(data)) } }).Start() } ```