client

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 13 Imported by: 5

Documentation

Index

Constants

View Source
const CommandNameClient = "client"

Variables

This section is empty.

Functions

func AddPluginRedirect

func AddPluginRedirect(redirect ServerRedirect)

add a client plugin

func AddPluginVersion added in v0.3.0

func AddPluginVersion(verPlugin VersionPlugin)

Types

type Handles added in v0.3.1

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

type Plugin

type Plugin struct {
	RedirectPlugin ServerRedirect
	VersionPlugin  VersionPlugin
}

func (*Plugin) HasRedirectPlugin added in v0.3.0

func (plugin *Plugin) HasRedirectPlugin() bool

check whether the redirect plugin has been added. this plugin can only be at most one instance.

func (*Plugin) HasVersionPlugin added in v0.3.0

func (plugin *Plugin) HasVersionPlugin() bool

type ServerRedirect

type ServerRedirect interface {
	// in the plugin, we may add http header and modify remote address.
	BeforeRequest(dialer *websocket.Dialer, url *url.URL, header http.Header) error
}

type VersionPlugin added in v0.3.0

type VersionPlugin interface {
	OnServerVersion(ver wss.VersionNeg) error
}

Jump to

Keyboard shortcuts

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