websocket

package
v0.0.0-...-e91929a Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeCounts

func ServeCounts(getter func() int, setter func(int))

ServeCounts increment/decrement websocket client count, increment pushed count, increment socket ID

func SetOrigin

func SetOrigin(org string)

SetOrigin set websocket origin "/scheme://host(:port)/" or "" (will not check)

func WsHandler

func WsHandler(w http.ResponseWriter, r *http.Request)

WsHandler serve websocket

Types

type Message

type Message struct {
	Message string `json:"message"`
	Count   int    `json:"count"`
	Clients int    `json:"clients"`
}

Message is format to send information Server send Message and client send "ping"

Jump to

Keyboard shortcuts

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