增加对当前连接发送消息的方法
This commit is contained in:
@ -10,6 +10,8 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-developer/websocket/message"
|
||||
|
||||
"github.com/go-developer/websocket"
|
||||
"github.com/go-developer/websocket/abstract"
|
||||
"github.com/go-developer/websocket/context"
|
||||
@ -24,6 +26,7 @@ type Example struct {
|
||||
|
||||
func (e Example) Connect(ctx *context.WSContext) {
|
||||
fmt.Println("建立连接成功")
|
||||
message.Response(ctx, map[string]interface{}{"say": "hello world!"})
|
||||
}
|
||||
|
||||
func (e Example) Disconnect(ctx *context.WSContext) {
|
||||
|
Reference in New Issue
Block a user