Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = (&Options{ OpCode: ws.OpText, Dialer: ws.DefaultDialer, Upgrader: ws.DefaultHTTPUpgrader, ServeMux: http.DefaultServeMux, Backlog: 128, NoDelay: true, CompressLevel: flate.BestSpeed, CompressThreshold: 512, }).Apply()
DefaultOptions default websocket options
Functions ¶
func WithOptions ¶
WithOptions to wrap the websocket options
Types ¶
type HTTPUpgrader ¶ added in v1.6.0
type HTTPUpgrader struct { Upgrader ws.HTTPUpgrader // contains filtered or unexported fields }
func NewHTTPUpgrader ¶ added in v1.6.0
func NewHTTPUpgrader(engine netty.Bootstrap, option ...transport.Option) HTTPUpgrader
func (HTTPUpgrader) Upgrade ¶ added in v1.6.0
func (hu HTTPUpgrader) Upgrade(writer http.ResponseWriter, request *http.Request) (netty.Channel, error)
type Options ¶
type Options struct { CertFile string `json:"certFile"` KeyFile string `json:"keyFile"` OpCode ws.OpCode `json:"opCode"` Routers []string `json:"routers"` CheckUTF8 bool `json:"checkUTF8"` MaxFrameSize int64 `json:"maxFrameSize"` ReadBufferSize int `json:"readBufferSize"` WriteBufferSize int `json:"writeBufferSize"` Backlog int `json:"backlog"` NoDelay bool `json:"nodelay"` CompressEnabled bool `json:"compressEnabled"` CompressLevel int `json:"compressLevel"` CompressThreshold int64 `json:"compressThreshold"` TLS *tls.Config `json:"-"` Dialer ws.Dialer `json:"-"` Upgrader ws.HTTPUpgrader `json:"-"` ServeMux *http.ServeMux `json:"-"` // contains filtered or unexported fields }
Options to define the websocket
func FromContext ¶
FromContext to unwrap the websocket options
Click to show internal directories.
Click to hide internal directories.