server

package
v1.0.0-...-3fe6b38 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WsNormalClosure           = 1000
	WsGoingAway               = 1001
	WsProtocolError           = 1002
	WsUnsupportedData         = 1003
	WsInvalidFramePayloadData = 1007
	WsPolicyViolation         = 1008
	WsMessageTooBig           = 1009
	WsMissingExtension        = 1010
	WsInternalError           = 1011
	WsServiceRestart          = 1012
	WsTryAgainLater           = 1013
	WsBadGateway              = 1014
)

WebSocket close codes

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	ListenIP   net.IP
	ListenPort uint16
	// contains filtered or unexported fields
}

func (*Server) ServeHTTP

func (server *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Implement http.Handler interface.

func (Server) Start

func (server Server) Start(bundle app.Bundle) error

Start prepares the server instance and starts listen for incoming requests. If some fields in the struct omitted they are initialized with default values. In most cases it's enough to provide valid ListenIP and ListenPort to start the server. When server started it blocks further execution of the current goroutine.

func (*Server) Stop

func (server *Server) Stop()

Stop the running server.

type WsCloseCode

type WsCloseCode = int

Jump to

Keyboard shortcuts

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