Preparing search index...
The search index is not available
@tarpit/http
@tarpit/http
TpWebSocket
Class TpWebSocket
Hierarchy
TpWebSocket
Index
Constructors
constructor
Properties
_listener_
error_
handler?
_socket
event_
need_
to_
wrap
Methods
close
off
on
on_
listener_
error
once
send
set_
listener
terminate
Constructors
constructor
new
Tp
Web
Socket
(
_socket
)
:
TpWebSocket
Parameters
_socket
:
WebSocket
Returns
TpWebSocket
Properties
Private
Optional
_listener_
error_
handler
_listener_
error_
handler
?:
ListenerErrorHandler
Private
_socket
_socket
:
WebSocket
Static
event_
need_
to_
wrap
event_
need_
to_
wrap
:
EventNeedToWrap
[]
= ...
Methods
close
close
(
code
?
,
data
?
)
:
void
Parameters
Optional
code
:
number
Optional
data
:
string
|
Buffer
Returns
void
off
off
(
event
)
:
TpWebSocket
Parameters
event
:
EventNeedToWrap
Returns
TpWebSocket
on
on
(
event
,
listener
)
:
TpWebSocket
Parameters
event
:
"close"
listener
:
(
(
code
,
reason
)
=>
void
)
(
code
,
reason
)
:
void
Parameters
code
:
number
reason
:
Buffer
Returns
void
Returns
TpWebSocket
on
(
event
,
listener
)
:
TpWebSocket
Parameters
event
:
"error"
listener
:
(
(
err
)
=>
void
)
(
err
)
:
void
Parameters
err
:
Error
Returns
void
Returns
TpWebSocket
on
(
event
,
listener
)
:
TpWebSocket
Parameters
event
:
"message"
listener
:
(
(
data
,
isBinary
)
=>
void
)
(
data
,
isBinary
)
:
void
Parameters
data
:
Buffer
isBinary
:
boolean
Returns
void
Returns
TpWebSocket
on_
listener_
error
on_
listener_
error
(
handler
)
:
void
Parameters
handler
:
ListenerErrorHandler
Returns
void
once
once
(
event
,
listener
)
:
TpWebSocket
Parameters
event
:
"close"
listener
:
(
(
code
,
reason
)
=>
void
)
(
code
,
reason
)
:
void
Parameters
code
:
number
reason
:
Buffer
Returns
void
Returns
TpWebSocket
once
(
event
,
listener
)
:
TpWebSocket
Parameters
event
:
"error"
listener
:
(
(
err
)
=>
void
)
(
err
)
:
void
Parameters
err
:
Error
Returns
void
Returns
TpWebSocket
once
(
event
,
listener
)
:
TpWebSocket
Parameters
event
:
"message"
listener
:
(
(
data
,
isBinary
)
=>
void
)
(
data
,
isBinary
)
:
void
Parameters
data
:
Buffer
isBinary
:
boolean
Returns
void
Returns
TpWebSocket
send
send
(
data
)
:
Promise
<
undefined
|
Error
>
Parameters
data
:
BufferLike
Returns
Promise
<
undefined
|
Error
>
send
(
data
,
options
?
)
:
Promise
<
undefined
|
Error
>
Parameters
data
:
BufferLike
Optional
options
:
SendMessageOptions
Returns
Promise
<
undefined
|
Error
>
Private
set_
listener
set_
listener
(
event
,
once
,
listener
)
:
TpWebSocket
Parameters
event
:
string
|
symbol
once
:
boolean
listener
:
(
(
...
args
)
=>
void
)
(
...
args
)
:
void
Parameters
Rest
...
args
:
any
[]
Returns
void
Returns
TpWebSocket
terminate
terminate
(
)
:
void
Returns
void
Settings
Member Visibility
Protected
Private
Inherited
External
Theme
OS
Light
Dark
src
errors
finish.ts
Finish
finish
tp-http-finish.ts
TpHttpFinish
TpHttpErrorDescription
TpHttpErrorHeader
throw_bad_request
throw_forbidden
throw_http_finish
throw_internal_server_error
throw_not_found
throw_not_modified
throw_precondition_failed
throw_unauthorized
builtin
body
form-body.ts
FormBody
json-body.ts
JsonBody
mime-body.ts
MimeBody
raw-body.ts
RawBody
text-body.ts
TextBody
dict
params.ts
Params
path-args.ts
PathArgs
header.ts
RequestHeaders
guard.ts
Guard
http-context.ts
HttpContext
response-cache.ts
ResponseCache
tp-request.ts
TpRequest
tp-response.ts
TpResponse
tp-websocket.ts
TpWebSocket
services
http-authenticator.ts
HttpAuthenticator
http-body-formatter.ts
HttpBodyFormatter
http-cache-proxy.ts
HttpCacheProxy
http-hooks.ts
HttpHooks
http-inspector.ts
HttpInspector
http-static.ts
HttpStatic
http-server.module.ts
HttpServerModule
__types__.ts
HttpCredentials
HttpHandlerDescriptor
HttpSession
TpRouterOptions
TpWebSocketOptions
ApiMethod
HttpResponseType
ProxyConfig
RequestHandler
RequestHandlerWithPathArgs
SocketHandler
TpHttpResponseType
UpgradeHandler
UpgradeHandlerWithPathArgs
annotations.ts
Auth
CacheUnder
ContentType
Delete
Get
Post
Put
Route
RouteProps
TpRouter
WS
Auth
CacheUnder
ContentType
Delete
Get
Post
Put
Route
TpRouter
WS
Generated using
TypeDoc