Categorygithub.com/404669366/wsclient
modulepackage
0.0.6
Repository: https://github.com/404669366/wsclient.git
Documentation: pkg.go.dev

# README

websocket client

websocket client for gorilla/websocket.

go get github.com/404669366/wsclient@latest
package main

import (
	"fmt"
	"github.com/404669366/wsclient"
	"github.com/gin-gonic/gin"
	"github.com/gorilla/websocket"
	"net/http"
)

func main() {
	server := gin.Default()

	upGrader := websocket.Upgrader{
		ReadBufferSize:  1024,
		WriteBufferSize: 1024,
		CheckOrigin: func(r *http.Request) bool {
			return true
		},
	}
	
	server.GET("/ws", func(ctx *gin.Context) {
		conn, _ := upGrader.Upgrade(ctx.Writer, ctx.Request, nil)
		wsclient.Mount(conn)
	})

	_ = server.Run(":8080")
}

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author