v1.5.12 Latest Latest

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 4 Imported by: 2




This section is empty.


This section is empty.


This section is empty.


type AllowRequest

type AllowRequest func(*types.HttpContext) error

type AttachOptions

type AttachOptions struct {
	// contains filtered or unexported fields

func DefaultAttachOptions

func DefaultAttachOptions() *AttachOptions

func (*AttachOptions) AddTrailingSlash added in v1.3.0

func (a *AttachOptions) AddTrailingSlash() bool

func (*AttachOptions) Assign added in v1.0.12

func (*AttachOptions) DestroyUpgrade

func (a *AttachOptions) DestroyUpgrade() bool

func (*AttachOptions) DestroyUpgradeTimeout

func (a *AttachOptions) DestroyUpgradeTimeout() time.Duration

func (*AttachOptions) GetRawAddTrailingSlash added in v1.3.0

func (a *AttachOptions) GetRawAddTrailingSlash() *bool

func (*AttachOptions) GetRawDestroyUpgrade added in v1.0.12

func (a *AttachOptions) GetRawDestroyUpgrade() *bool

func (*AttachOptions) GetRawDestroyUpgradeTimeout added in v1.0.12

func (a *AttachOptions) GetRawDestroyUpgradeTimeout() *time.Duration

func (*AttachOptions) GetRawPath added in v1.0.12

func (a *AttachOptions) GetRawPath() *string

func (*AttachOptions) Path

func (a *AttachOptions) Path() string

func (*AttachOptions) SetAddTrailingSlash added in v1.3.0

func (a *AttachOptions) SetAddTrailingSlash(addTrailingSlash bool)

Whether we should add a trailing slash to the request path. @default true

func (*AttachOptions) SetDestroyUpgrade

func (a *AttachOptions) SetDestroyUpgrade(destroyUpgrade bool)

destroy unhandled upgrade requests @default true

func (*AttachOptions) SetDestroyUpgradeTimeout

func (a *AttachOptions) SetDestroyUpgradeTimeout(destroyUpgradeTimeout time.Duration)

milliseconds after which unhandled requests are ended @default 1000

func (*AttachOptions) SetPath

func (a *AttachOptions) SetPath(path string)

name of the path to capture @default "/"

type AttachOptionsInterface added in v1.0.12

type AttachOptionsInterface interface {
	GetRawPath() *string
	Path() string

	GetRawDestroyUpgrade() *bool
	DestroyUpgrade() bool

	GetRawDestroyUpgradeTimeout() *time.Duration
	DestroyUpgradeTimeout() time.Duration

	GetRawAddTrailingSlash() *bool
	AddTrailingSlash() bool

type ServerOptions

type ServerOptions struct {
	// contains filtered or unexported fields

func DefaultServerOptions

func DefaultServerOptions() *ServerOptions

func (*ServerOptions) AllowEIO3

func (s *ServerOptions) AllowEIO3() bool

func (*ServerOptions) AllowRequest

func (s *ServerOptions) AllowRequest() AllowRequest

func (*ServerOptions) AllowUpgrades

func (s *ServerOptions) AllowUpgrades() bool

func (*ServerOptions) Assign

func (*ServerOptions) Cookie

func (s *ServerOptions) Cookie() *http.Cookie

func (*ServerOptions) Cors

func (s *ServerOptions) Cors() *types.Cors

func (*ServerOptions) GetRawAllowEIO3 added in v1.0.12

func (s *ServerOptions) GetRawAllowEIO3() *bool

func (*ServerOptions) GetRawAllowRequest added in v1.0.12

func (s *ServerOptions) GetRawAllowRequest() AllowRequest

func (*ServerOptions) GetRawAllowUpgrades added in v1.0.12

func (s *ServerOptions) GetRawAllowUpgrades() *bool

func (*ServerOptions) GetRawCookie added in v1.0.12

func (s *ServerOptions) GetRawCookie() *http.Cookie

func (*ServerOptions) GetRawCors added in v1.0.12

func (s *ServerOptions) GetRawCors() *types.Cors

func (*ServerOptions) GetRawHttpCompression added in v1.0.12

func (s *ServerOptions) GetRawHttpCompression() *types.HttpCompression

func (*ServerOptions) GetRawInitialPacket added in v1.0.12

func (s *ServerOptions) GetRawInitialPacket() io.Reader

func (*ServerOptions) GetRawMaxHttpBufferSize added in v1.0.12

func (s *ServerOptions) GetRawMaxHttpBufferSize() *int64

func (*ServerOptions) GetRawPerMessageDeflate added in v1.0.12

func (s *ServerOptions) GetRawPerMessageDeflate() *types.PerMessageDeflate

func (*ServerOptions) GetRawPingInterval added in v1.0.12

func (s *ServerOptions) GetRawPingInterval() *time.Duration

func (*ServerOptions) GetRawPingTimeout added in v1.0.12

func (s *ServerOptions) GetRawPingTimeout() *time.Duration

func (*ServerOptions) GetRawTransports added in v1.0.12

func (s *ServerOptions) GetRawTransports() *types.Set[string]

func (*ServerOptions) GetRawUpgradeTimeout added in v1.0.12

func (s *ServerOptions) GetRawUpgradeTimeout() *time.Duration

func (*ServerOptions) HttpCompression

func (s *ServerOptions) HttpCompression() *types.HttpCompression

func (*ServerOptions) InitialPacket

func (s *ServerOptions) InitialPacket() io.Reader

func (*ServerOptions) MaxHttpBufferSize

func (s *ServerOptions) MaxHttpBufferSize() int64

func (*ServerOptions) PerMessageDeflate

func (s *ServerOptions) PerMessageDeflate() *types.PerMessageDeflate

func (*ServerOptions) PingInterval

func (s *ServerOptions) PingInterval() time.Duration

func (*ServerOptions) PingTimeout

func (s *ServerOptions) PingTimeout() time.Duration

func (*ServerOptions) SetAllowEIO3

func (s *ServerOptions) SetAllowEIO3(allowEIO3 bool)

whether to enable compatibility with Socket.IO v2 clients @default false

func (*ServerOptions) SetAllowRequest

func (s *ServerOptions) SetAllowRequest(allowRequest AllowRequest)

A function that receives a given handshake or upgrade request as its first parameter, and can decide whether to continue or not. The second argument is a function that needs to be called with the decided information: fn(err, success), where success is a boolean value where false means that the request is rejected, and err is an error code.

func (*ServerOptions) SetAllowUpgrades

func (s *ServerOptions) SetAllowUpgrades(allowUpgrades bool)

whether to allow transport upgrades @default true

func (*ServerOptions) SetCookie

func (s *ServerOptions) SetCookie(cookie *http.Cookie)

configuration of the cookie that contains the client sid to send as part of handshake response headers. This cookie might be used for sticky-session. Defaults to not sending any cookie. @default false

func (*ServerOptions) SetCors

func (s *ServerOptions) SetCors(cors *types.Cors)

the options that will be forwarded to the cors module

func (*ServerOptions) SetHttpCompression

func (s *ServerOptions) SetHttpCompression(httpCompression *types.HttpCompression)

parameters of the http compression for the polling transports (see zlib api docs). Set to false to disable. @default true

func (*ServerOptions) SetInitialPacket

func (s *ServerOptions) SetInitialPacket(initialPacket io.Reader)

an optional packet which will be concatenated to the handshake packet emitted by Engine.IO.

func (*ServerOptions) SetMaxHttpBufferSize

func (s *ServerOptions) SetMaxHttpBufferSize(maxHttpBufferSize int64)

how many bytes or characters a message can be, before closing the session (to avoid DoS). @default 1e5 (100 KB)

func (*ServerOptions) SetPerMessageDeflate

func (s *ServerOptions) SetPerMessageDeflate(perMessageDeflate *types.PerMessageDeflate)

parameters of the WebSocket permessage-deflate extension (see ws module api docs). Set to false to disable. @default nil

func (*ServerOptions) SetPingInterval

func (s *ServerOptions) SetPingInterval(pingInterval time.Duration)

how many ms before sending a new ping packet @default 25_000

func (*ServerOptions) SetPingTimeout

func (s *ServerOptions) SetPingTimeout(pingTimeout time.Duration)

how many ms without a pong packet to consider the connection closed @default 20_000

func (*ServerOptions) SetTransports

func (s *ServerOptions) SetTransports(transports *types.Set[string])

the low-level transports that are enabled @default ["polling", "websocket"]

func (*ServerOptions) SetUpgradeTimeout

func (s *ServerOptions) SetUpgradeTimeout(upgradeTimeout time.Duration)

how many ms before an uncompleted transport upgrade is cancelled @default 10_000

func (*ServerOptions) Transports

func (s *ServerOptions) Transports() *types.Set[string]

func (*ServerOptions) UpgradeTimeout

func (s *ServerOptions) UpgradeTimeout() time.Duration

type ServerOptionsInterface added in v1.0.12

type ServerOptionsInterface interface {
	GetRawPingTimeout() *time.Duration
	PingTimeout() time.Duration

	GetRawPingInterval() *time.Duration
	PingInterval() time.Duration

	GetRawUpgradeTimeout() *time.Duration
	UpgradeTimeout() time.Duration

	GetRawMaxHttpBufferSize() *int64
	MaxHttpBufferSize() int64

	GetRawAllowRequest() AllowRequest
	AllowRequest() AllowRequest

	GetRawTransports() *types.Set[string]
	Transports() *types.Set[string]

	GetRawAllowUpgrades() *bool
	AllowUpgrades() bool

	GetRawPerMessageDeflate() *types.PerMessageDeflate
	PerMessageDeflate() *types.PerMessageDeflate

	GetRawHttpCompression() *types.HttpCompression
	HttpCompression() *types.HttpCompression

	GetRawInitialPacket() io.Reader
	InitialPacket() io.Reader

	GetRawCookie() *http.Cookie
	Cookie() *http.Cookie

	GetRawCors() *types.Cors
	Cors() *types.Cors

	GetRawAllowEIO3() *bool
	AllowEIO3() bool

Jump to

Keyboard shortcuts

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