33 lines
664 B
Go
33 lines
664 B
Go
|
package websocket_fasthttp
|
||
|
|
||
|
import (
|
||
|
"net"
|
||
|
"time"
|
||
|
|
||
|
"github.com/valyala/fasthttp"
|
||
|
)
|
||
|
|
||
|
type ServerHandler interface {
|
||
|
Listen() (net.Listener, error)
|
||
|
CheckOrigin(ctx *fasthttp.RequestCtx) bool
|
||
|
OnError(ctx *fasthttp.RequestCtx, status int, reason error)
|
||
|
|
||
|
OnStart()
|
||
|
OnStop()
|
||
|
|
||
|
RegisterSocketHandler(path string, handler SocketHandler)
|
||
|
GetSocketHandler(path string) (SocketHandler, error)
|
||
|
|
||
|
GetName() string
|
||
|
GetConcurrency() int
|
||
|
GetMaxStopWaitTime() time.Duration
|
||
|
GetHandshakeTimeout() time.Duration
|
||
|
GetReadBufferSize() int
|
||
|
GetWriteBufferSize() int
|
||
|
GetReadTimeout() time.Duration
|
||
|
GetWriteTimeout() time.Duration
|
||
|
IsEnableCompression() bool
|
||
|
|
||
|
Validate()
|
||
|
}
|