ws

package
v0.0.0-...-61b4dbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2019 License: MIT Imports: 3 Imported by: 0

README

Golang Websocket

usage

  1. go get -u github.com/bugfan/conn/ws

参阅github.com/bugfan/conn目录下面的ws_tes.gows_client_test.html 代码

Websocket使用步骤

  1. 生成Upgrade

avatar

  1. 使用Upgrader生成链接 并设法保存(案例使用map保存,便于查找)

avatar

  1. 接收消息

avatar

  1. 发送消息

avatar

  1. 客户端界面显示

avatar

  1. 服务器端控制抬输出

avatar

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func InitConnection

func InitConnection(wsConn *websocket.Conn) (conn *Connection, err error)

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) ReadMessage

func (c *Connection) ReadMessage() (data []byte, err error)

func (*Connection) WriteMessage

func (c *Connection) WriteMessage(data []byte) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL