Search
Preparing search index...
The search index is not available
Sociably
Options
All
Public
Public/Protected
All
Inherited
Externals
Menu
Sociably
websocket
WebSocketServer
Class WebSocketServer<User, Auth>
Type parameters
User
:
null
|
SociablyUser
Auth
Hierarchy
Emitter
<
ServerEvents
<
User
,
Auth
>
>
WebSocketServer
Index
Constructors
constructor
Properties
id
marshaler
Methods
add
Listener
disconnect
dispatch
emit
event
Names
get
Max
Listeners
handle
Upgrade
listener
Count
listeners
off
on
once
prepend
Listener
prepend
Once
Listener
raw
Listeners
remove
All
Listeners
remove
Listener
set
Max
Listeners
start
stop
subscribe
Topic
unsubscribe
Topic
Constructors
constructor
new
Web
Socket
Server
<
User
,
Auth
>
(
__namedParameters
:
ServerOptions
<
User
,
Auth
>
)
:
WebSocketServer
<
User
,
Auth
>
Type parameters
User
:
null
|
SociablyUser
Auth
Parameters
__namedParameters:
ServerOptions
<
User
,
Auth
>
Returns
WebSocketServer
<
User
,
Auth
>
Properties
id
id
:
string
marshaler
marshaler
:
Marshaler
Methods
add
Listener
add
Listener
<
E
>
(
event
:
E
, listener
:
ServerEvents
<
User
,
Auth
>
[
E
]
)
:
WebSocketServer
<
User
,
Auth
>
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
event:
E
listener:
ServerEvents
<
User
,
Auth
>
[
E
]
Returns
WebSocketServer
<
User
,
Auth
>
disconnect
disconnect
(
conn
:
ConnIdentifier
, reason
?:
string
)
:
Promise
<
boolean
>
Parameters
conn:
ConnIdentifier
Optional
reason:
string
Returns
Promise
<
boolean
>
dispatch
dispatch
(
job
:
WebSocketJob
)
:
Promise
<
ConnIdentifier
[]
>
Parameters
job:
WebSocketJob
Returns
Promise
<
ConnIdentifier
[]
>
emit
emit
<
E
>
(
event
:
E
,
...
args
:
Arguments
<
ServerEvents
<
User
,
Auth
>
[
E
]
>
)
:
boolean
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
event:
E
Rest
...
args:
Arguments
<
ServerEvents
<
User
,
Auth
>
[
E
]
>
Returns
boolean
event
Names
event
Names
(
)
:
(
string
|
symbol
)
[]
Returns
(
string
|
symbol
)
[]
get
Max
Listeners
get
Max
Listeners
(
)
:
number
Returns
number
handle
Upgrade
handle
Upgrade
(
req
:
IncomingMessage
, ns
:
Socket
, head
:
Buffer
)
:
Promise
<
void
>
Parameters
req:
IncomingMessage
ns:
Socket
head:
Buffer
Returns
Promise
<
void
>
listener
Count
listener
Count
<
E
>
(
event
:
E
)
:
number
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
event:
E
Returns
number
listeners
listeners
<
E
>
(
event
:
E
)
:
Function
[]
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
event:
E
Returns
Function
[]
off
off
<
E
>
(
event
:
E
, listener
:
ServerEvents
<
User
,
Auth
>
[
E
]
)
:
WebSocketServer
<
User
,
Auth
>
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
event:
E
listener:
ServerEvents
<
User
,
Auth
>
[
E
]
Returns
WebSocketServer
<
User
,
Auth
>
on
on
<
E
>
(
event
:
E
, listener
:
ServerEvents
<
User
,
Auth
>
[
E
]
)
:
WebSocketServer
<
User
,
Auth
>
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
event:
E
listener:
ServerEvents
<
User
,
Auth
>
[
E
]
Returns
WebSocketServer
<
User
,
Auth
>
once
once
<
E
>
(
event
:
E
, listener
:
ServerEvents
<
User
,
Auth
>
[
E
]
)
:
WebSocketServer
<
User
,
Auth
>
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
event:
E
listener:
ServerEvents
<
User
,
Auth
>
[
E
]
Returns
WebSocketServer
<
User
,
Auth
>
prepend
Listener
prepend
Listener
<
E
>
(
event
:
E
, listener
:
ServerEvents
<
User
,
Auth
>
[
E
]
)
:
WebSocketServer
<
User
,
Auth
>
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
event:
E
listener:
ServerEvents
<
User
,
Auth
>
[
E
]
Returns
WebSocketServer
<
User
,
Auth
>
prepend
Once
Listener
prepend
Once
Listener
<
E
>
(
event
:
E
, listener
:
ServerEvents
<
User
,
Auth
>
[
E
]
)
:
WebSocketServer
<
User
,
Auth
>
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
event:
E
listener:
ServerEvents
<
User
,
Auth
>
[
E
]
Returns
WebSocketServer
<
User
,
Auth
>
raw
Listeners
raw
Listeners
<
E
>
(
event
:
E
)
:
Function
[]
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
event:
E
Returns
Function
[]
remove
All
Listeners
remove
All
Listeners
<
E
>
(
event
?:
E
)
:
WebSocketServer
<
User
,
Auth
>
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
Optional
event:
E
Returns
WebSocketServer
<
User
,
Auth
>
remove
Listener
remove
Listener
<
E
>
(
event
:
E
, listener
:
ServerEvents
<
User
,
Auth
>
[
E
]
)
:
WebSocketServer
<
User
,
Auth
>
Type parameters
E
:
keyof
ServerEvents
<
User
,
Auth
>
Parameters
event:
E
listener:
ServerEvents
<
User
,
Auth
>
[
E
]
Returns
WebSocketServer
<
User
,
Auth
>
set
Max
Listeners
set
Max
Listeners
(
maxListeners
:
number
)
:
WebSocketServer
<
User
,
Auth
>
Parameters
maxListeners:
number
Returns
WebSocketServer
<
User
,
Auth
>
start
start
(
)
:
Promise
<
void
>
Returns
Promise
<
void
>
stop
stop
(
)
:
Promise
<
void
>
Returns
Promise
<
void
>
subscribe
Topic
subscribe
Topic
(
conn
:
ConnIdentifier
, topic
:
string
)
:
Promise
<
boolean
>
Parameters
conn:
ConnIdentifier
topic:
string
Returns
Promise
<
boolean
>
unsubscribe
Topic
unsubscribe
Topic
(
conn
:
ConnIdentifier
, topic
:
string
)
:
Promise
<
boolean
>
Parameters
conn:
ConnIdentifier
topic:
string
Returns
Promise
<
boolean
>
Modules
auth
core
create-
app
dev-
tools
dialogflow
http
line
messenger
next
redis-
state
script
stream
telegram
twitter
websocket
websocket/broker/
Local
Only
Broker
websocket/client
websocket/utils
default
webview
Web
Socket
Server
constructor
id
marshaler
add
Listener
disconnect
dispatch
emit
event
Names
get
Max
Listeners
handle
Upgrade
listener
Count
listeners
off
on
once
prepend
Listener
prepend
Once
Listener
raw
Listeners
remove
All
Listeners
remove
Listener
set
Max
Listeners
start
stop
subscribe
Topic
unsubscribe
Topic
Generated using
TypeDoc