Update docs for v20.4
1
docs/generated/.nojekyll
Normal file
@ -0,0 +1 @@
|
||||
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
|
22
docs/generated/assets/highlight.css
Normal file
@ -0,0 +1,22 @@
|
||||
:root {
|
||||
--light-code-background: #FFFFFF;
|
||||
--dark-code-background: #1E1E1E;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) { :root {
|
||||
--code-background: var(--light-code-background);
|
||||
} }
|
||||
|
||||
@media (prefers-color-scheme: dark) { :root {
|
||||
--code-background: var(--dark-code-background);
|
||||
} }
|
||||
|
||||
body.light {
|
||||
--code-background: var(--light-code-background);
|
||||
}
|
||||
|
||||
body.dark {
|
||||
--code-background: var(--dark-code-background);
|
||||
}
|
||||
|
||||
pre, code { background: var(--code-background); }
|
1043
docs/generated/assets/icons.css
Normal file
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
248
docs/generated/assets/js/main.js
vendored
1
docs/generated/assets/js/search.js
vendored
52
docs/generated/assets/main.js
vendored
Normal file
1
docs/generated/assets/search.js
vendored
Normal file
1388
docs/generated/assets/style.css
Normal file
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 855 B After Width: | Height: | Size: 855 B |
@ -1,295 +1,6 @@
|
||||
<!doctype html>
|
||||
<html class="default no-js">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>AppOptions | uWebSockets.js v19.3.0 documentation</title>
|
||||
<meta name="description" content="Documentation for uWebSockets.js v19.3.0 documentation">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../assets/css/main.css">
|
||||
<script async src="../assets/js/search.js" id="search-script"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="tsd-page-toolbar">
|
||||
<div class="container">
|
||||
<div class="table-wrap">
|
||||
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
||||
<div class="field">
|
||||
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
||||
<input id="tsd-search-field" type="text" />
|
||||
</div>
|
||||
<ul class="results">
|
||||
<li class="state loading">Preparing search index...</li>
|
||||
<li class="state failure">The search index is not available</li>
|
||||
</ul>
|
||||
<a href="../index.html" class="title">uWebSockets.js v19.3.0 documentation</a>
|
||||
</div>
|
||||
<div class="table-cell" id="tsd-widgets">
|
||||
<div id="tsd-filter">
|
||||
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
||||
<div class="tsd-filter-group">
|
||||
<div class="tsd-select" id="tsd-filter-visibility">
|
||||
<span class="tsd-select-label">All</span>
|
||||
<ul class="tsd-select-list">
|
||||
<li data-value="public">Public</li>
|
||||
<li data-value="protected">Public/Protected</li>
|
||||
<li data-value="private" class="selected">All</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="checkbox" id="tsd-filter-inherited" checked />
|
||||
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tsd-page-title">
|
||||
<div class="container">
|
||||
<ul class="tsd-breadcrumb">
|
||||
<li>
|
||||
<a href="../index.html">uWebSockets.js v19.3.0 documentation</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="AppOptions.html">AppOptions</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h1>Interface AppOptions</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container container-main">
|
||||
<div class="row">
|
||||
<div class="col-8 col-content">
|
||||
<section class="tsd-panel tsd-comment">
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Options used when constructing an app. Especially for SSLApp.
|
||||
These are options passed directly to uSockets, C layer.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-hierarchy">
|
||||
<h3>Hierarchy</h3>
|
||||
<ul class="tsd-hierarchy">
|
||||
<li>
|
||||
<span class="target">AppOptions</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel-group tsd-index-group">
|
||||
<h2>Index</h2>
|
||||
<section class="tsd-panel tsd-index-panel">
|
||||
<div class="tsd-index-content">
|
||||
<section class="tsd-index-section ">
|
||||
<h3>Properties</h3>
|
||||
<ul class="tsd-index-list">
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#cert_file_name" class="tsd-kind-icon">cert_<wbr>file_<wbr>name</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#dh_params_file_name" class="tsd-kind-icon">dh_<wbr>params_<wbr>file_<wbr>name</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#key_file_name" class="tsd-kind-icon">key_<wbr>file_<wbr>name</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#passphrase" class="tsd-kind-icon">passphrase</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#ssl_prefer_low_memory_usage" class="tsd-kind-icon">ssl_<wbr>prefer_<wbr>low_<wbr>memory_<wbr>usage</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section class="tsd-panel-group tsd-member-group ">
|
||||
<h2>Properties</h2>
|
||||
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
||||
<a name="cert_file_name" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> cert_<wbr>file_<wbr>name</h3>
|
||||
<div class="tsd-signature tsd-kind-icon">cert_<wbr>file_<wbr>name<span class="tsd-signature-symbol">:</span> <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L263">index.d.ts:263</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
||||
<a name="dh_params_file_name" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> dh_<wbr>params_<wbr>file_<wbr>name</h3>
|
||||
<div class="tsd-signature tsd-kind-icon">dh_<wbr>params_<wbr>file_<wbr>name<span class="tsd-signature-symbol">:</span> <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L265">index.d.ts:265</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
||||
<a name="key_file_name" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> key_<wbr>file_<wbr>name</h3>
|
||||
<div class="tsd-signature tsd-kind-icon">key_<wbr>file_<wbr>name<span class="tsd-signature-symbol">:</span> <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L262">index.d.ts:262</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
||||
<a name="passphrase" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> passphrase</h3>
|
||||
<div class="tsd-signature tsd-kind-icon">passphrase<span class="tsd-signature-symbol">:</span> <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L264">index.d.ts:264</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
||||
<a name="ssl_prefer_low_memory_usage" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> ssl_<wbr>prefer_<wbr>low_<wbr>memory_<wbr>usage</h3>
|
||||
<div class="tsd-signature tsd-kind-icon">ssl_<wbr>prefer_<wbr>low_<wbr>memory_<wbr>usage<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L267">index.d.ts:267</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>This translates to SSL_MODE_RELEASE_BUFFERS</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
||||
<nav class="tsd-navigation primary">
|
||||
<ul>
|
||||
<li class=" ">
|
||||
<a href="../index.html">Exports</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav class="tsd-navigation secondary menu-sticky">
|
||||
<ul class="before-current">
|
||||
<li class=" tsd-kind-enum">
|
||||
<a href="../enums/ListenOptions.html" class="tsd-kind-icon">Listen<wbr>Options</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="current">
|
||||
<li class="current tsd-kind-interface">
|
||||
<a href="AppOptions.html" class="tsd-kind-icon">App<wbr>Options</a>
|
||||
<ul>
|
||||
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
||||
<a href="AppOptions.html#cert_file_name" class="tsd-kind-icon">cert_<wbr>file_<wbr>name</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
||||
<a href="AppOptions.html#dh_params_file_name" class="tsd-kind-icon">dh_<wbr>params_<wbr>file_<wbr>name</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
||||
<a href="AppOptions.html#key_file_name" class="tsd-kind-icon">key_<wbr>file_<wbr>name</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
||||
<a href="AppOptions.html#passphrase" class="tsd-kind-icon">passphrase</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
||||
<a href="AppOptions.html#ssl_prefer_low_memory_usage" class="tsd-kind-icon">ssl_<wbr>prefer_<wbr>low_<wbr>memory_<wbr>usage</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="after-current">
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpRequest.html" class="tsd-kind-icon">Http<wbr>Request</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpResponse.html" class="tsd-kind-icon">Http<wbr>Response</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="MultipartField.html" class="tsd-kind-icon">Multipart<wbr>Field</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="TemplatedApp.html" class="tsd-kind-icon">Templated<wbr>App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocketBehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket.html" class="tsd-kind-icon">us_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket_context_t.html" class="tsd-kind-icon">us_<wbr>socket_<wbr>context_<wbr>t</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#CompressOptions" class="tsd-kind-icon">Compress<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#RecognizedString" class="tsd-kind-icon">Recognized<wbr>String</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_128KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>128KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_16KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>16KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_256KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>256KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_32KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>32KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_3KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>3KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_4KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>4KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_64KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>64KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_8KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>8KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DISABLED" class="tsd-kind-icon">DISABLED</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#SHARED_COMPRESSOR" class="tsd-kind-icon">SHARED_<wbr>COMPRESSOR</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#App" class="tsd-kind-icon">App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#SSLApp" class="tsd-kind-icon">SSLApp</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#getParts" class="tsd-kind-icon">get<wbr>Parts</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_socket_local_port" class="tsd-kind-icon">us_<wbr>socket_<wbr>local_<wbr>port</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="with-border-bottom">
|
||||
<div class="container">
|
||||
<h2>Legend</h2>
|
||||
<div class="tsd-legend-group">
|
||||
<ul class="tsd-legend">
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="container tsd-generator">
|
||||
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
||||
</div>
|
||||
<div class="overlay"></div>
|
||||
<script src="../assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>AppOptions | uWebSockets.js v20.4.0 documentation</title><meta name="description" content="Documentation for uWebSockets.js v20.4.0 documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">uWebSockets.js v20.4.0 documentation</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../index.html">uWebSockets.js v20.4.0 documentation</a></li><li><a href="AppOptions.html">AppOptions</a></li></ul><h1>Interface AppOptions</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Options used when constructing an app. Especially for SSLApp.
|
||||
These are options passed directly to uSockets, C layer.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">AppOptions</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#cert_file_name" class="tsd-kind-icon">cert_<wbr/>file_<wbr/>name</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#dh_params_file_name" class="tsd-kind-icon">dh_<wbr/>params_<wbr/>file_<wbr/>name</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#key_file_name" class="tsd-kind-icon">key_<wbr/>file_<wbr/>name</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#passphrase" class="tsd-kind-icon">passphrase</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#ssl_prefer_low_memory_usage" class="tsd-kind-icon">ssl_<wbr/>prefer_<wbr/>low_<wbr/>memory_<wbr/>usage</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="cert_file_name" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> cert_<wbr/>file_<wbr/>name</h3><div class="tsd-signature tsd-kind-icon">cert_<wbr/>file_<wbr/>name<span class="tsd-signature-symbol">?:</span> <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L252">index.d.ts:252</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="dh_params_file_name" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> dh_<wbr/>params_<wbr/>file_<wbr/>name</h3><div class="tsd-signature tsd-kind-icon">dh_<wbr/>params_<wbr/>file_<wbr/>name<span class="tsd-signature-symbol">?:</span> <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L254">index.d.ts:254</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="key_file_name" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> key_<wbr/>file_<wbr/>name</h3><div class="tsd-signature tsd-kind-icon">key_<wbr/>file_<wbr/>name<span class="tsd-signature-symbol">?:</span> <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L251">index.d.ts:251</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="passphrase" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> passphrase</h3><div class="tsd-signature tsd-kind-icon">passphrase<span class="tsd-signature-symbol">?:</span> <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L253">index.d.ts:253</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="ssl_prefer_low_memory_usage" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> ssl_<wbr/>prefer_<wbr/>low_<wbr/>memory_<wbr/>usage</h3><div class="tsd-signature tsd-kind-icon">ssl_<wbr/>prefer_<wbr/>low_<wbr/>memory_<wbr/>usage<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L256">index.d.ts:256</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>This translates to SSL_MODE_RELEASE_BUFFERS</p>
|
||||
</div></div></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="AppOptions.html" class="tsd-kind-icon">App<wbr/>Options</a><ul><li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#cert_file_name" class="tsd-kind-icon">cert_<wbr/>file_<wbr/>name</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#dh_params_file_name" class="tsd-kind-icon">dh_<wbr/>params_<wbr/>file_<wbr/>name</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#key_file_name" class="tsd-kind-icon">key_<wbr/>file_<wbr/>name</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#passphrase" class="tsd-kind-icon">passphrase</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="AppOptions.html#ssl_prefer_low_memory_usage" class="tsd-kind-icon">ssl_<wbr/>prefer_<wbr/>low_<wbr/>memory_<wbr/>usage</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
@ -1,466 +1,19 @@
|
||||
<!doctype html>
|
||||
<html class="default no-js">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>HttpRequest | uWebSockets.js v19.3.0 documentation</title>
|
||||
<meta name="description" content="Documentation for uWebSockets.js v19.3.0 documentation">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../assets/css/main.css">
|
||||
<script async src="../assets/js/search.js" id="search-script"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="tsd-page-toolbar">
|
||||
<div class="container">
|
||||
<div class="table-wrap">
|
||||
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
||||
<div class="field">
|
||||
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
||||
<input id="tsd-search-field" type="text" />
|
||||
</div>
|
||||
<ul class="results">
|
||||
<li class="state loading">Preparing search index...</li>
|
||||
<li class="state failure">The search index is not available</li>
|
||||
</ul>
|
||||
<a href="../index.html" class="title">uWebSockets.js v19.3.0 documentation</a>
|
||||
</div>
|
||||
<div class="table-cell" id="tsd-widgets">
|
||||
<div id="tsd-filter">
|
||||
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
||||
<div class="tsd-filter-group">
|
||||
<div class="tsd-select" id="tsd-filter-visibility">
|
||||
<span class="tsd-select-label">All</span>
|
||||
<ul class="tsd-select-list">
|
||||
<li data-value="public">Public</li>
|
||||
<li data-value="protected">Public/Protected</li>
|
||||
<li data-value="private" class="selected">All</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="checkbox" id="tsd-filter-inherited" checked />
|
||||
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tsd-page-title">
|
||||
<div class="container">
|
||||
<ul class="tsd-breadcrumb">
|
||||
<li>
|
||||
<a href="../index.html">uWebSockets.js v19.3.0 documentation</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="HttpRequest.html">HttpRequest</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h1>Interface HttpRequest</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container container-main">
|
||||
<div class="row">
|
||||
<div class="col-8 col-content">
|
||||
<section class="tsd-panel tsd-comment">
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>An HttpRequest is stack allocated and only accessible during the callback invocation.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-hierarchy">
|
||||
<h3>Hierarchy</h3>
|
||||
<ul class="tsd-hierarchy">
|
||||
<li>
|
||||
<span class="target">HttpRequest</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel-group tsd-index-group">
|
||||
<h2>Index</h2>
|
||||
<section class="tsd-panel tsd-index-panel">
|
||||
<div class="tsd-index-content">
|
||||
<section class="tsd-index-section ">
|
||||
<h3>Methods</h3>
|
||||
<ul class="tsd-index-list">
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#forEach" class="tsd-kind-icon">for<wbr>Each</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getHeader" class="tsd-kind-icon">get<wbr>Header</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getMethod" class="tsd-kind-icon">get<wbr>Method</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getParameter" class="tsd-kind-icon">get<wbr>Parameter</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getQuery" class="tsd-kind-icon">get<wbr>Query</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getUrl" class="tsd-kind-icon">get<wbr>Url</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#setYield" class="tsd-kind-icon">set<wbr>Yield</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section class="tsd-panel-group tsd-member-group ">
|
||||
<h2>Methods</h2>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="forEach" class="tsd-anchor"></a>
|
||||
<h3>for<wbr>Each</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">for<wbr>Each<span class="tsd-signature-symbol">(</span>cb<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L223">index.d.ts:223</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Loops over all headers.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>cb: <span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5>
|
||||
<ul class="tsd-parameters">
|
||||
<li class="tsd-parameter-signature">
|
||||
<ul class="tsd-signatures tsd-kind-type-literal">
|
||||
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>key: <span class="tsd-signature-type">string</span></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>value: <span class="tsd-signature-type">string</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getHeader" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Header</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Header<span class="tsd-signature-symbol">(</span>lowerCaseKey<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L211">index.d.ts:211</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the lowercased header value or empty string.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>lowerCaseKey: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getMethod" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Method</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Method<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L217">index.d.ts:217</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the HTTP method, useful for "any" routes.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getParameter" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Parameter</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Parameter<span class="tsd-signature-symbol">(</span>index<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L213">index.d.ts:213</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the parsed parameter at index. Corresponds to route.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>index: <span class="tsd-signature-type">number</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getQuery" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Query</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Query<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Query<span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L219">index.d.ts:219</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the raw querystring (the part of URL after ? sign) or empty string.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
||||
</li>
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L221">index.d.ts:221</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns a decoded query parameter value or empty string.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>key: <span class="tsd-signature-type">string</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getUrl" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Url</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Url<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L215">index.d.ts:215</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the URL including initial /slash</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="setYield" class="tsd-anchor"></a>
|
||||
<h3>set<wbr>Yield</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">set<wbr>Yield<span class="tsd-signature-symbol">(</span>yield<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpRequest.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpRequest</a></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L225">index.d.ts:225</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Setting yield to true is to say that this route handler did not handle the route, causing the router to continue looking for a matching route handler, or fail.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>yield: <span class="tsd-signature-type">boolean</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <a href="HttpRequest.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpRequest</a></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
||||
<nav class="tsd-navigation primary">
|
||||
<ul>
|
||||
<li class=" ">
|
||||
<a href="../index.html">Exports</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav class="tsd-navigation secondary menu-sticky">
|
||||
<ul class="before-current">
|
||||
<li class=" tsd-kind-enum">
|
||||
<a href="../enums/ListenOptions.html" class="tsd-kind-icon">Listen<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="AppOptions.html" class="tsd-kind-icon">App<wbr>Options</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="current">
|
||||
<li class="current tsd-kind-interface">
|
||||
<a href="HttpRequest.html" class="tsd-kind-icon">Http<wbr>Request</a>
|
||||
<ul>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpRequest.html#forEach" class="tsd-kind-icon">for<wbr>Each</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpRequest.html#getHeader" class="tsd-kind-icon">get<wbr>Header</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpRequest.html#getMethod" class="tsd-kind-icon">get<wbr>Method</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpRequest.html#getParameter" class="tsd-kind-icon">get<wbr>Parameter</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpRequest.html#getQuery" class="tsd-kind-icon">get<wbr>Query</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpRequest.html#getUrl" class="tsd-kind-icon">get<wbr>Url</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpRequest.html#setYield" class="tsd-kind-icon">set<wbr>Yield</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="after-current">
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpResponse.html" class="tsd-kind-icon">Http<wbr>Response</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="MultipartField.html" class="tsd-kind-icon">Multipart<wbr>Field</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="TemplatedApp.html" class="tsd-kind-icon">Templated<wbr>App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocketBehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket.html" class="tsd-kind-icon">us_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket_context_t.html" class="tsd-kind-icon">us_<wbr>socket_<wbr>context_<wbr>t</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#CompressOptions" class="tsd-kind-icon">Compress<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#RecognizedString" class="tsd-kind-icon">Recognized<wbr>String</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_128KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>128KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_16KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>16KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_256KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>256KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_32KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>32KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_3KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>3KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_4KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>4KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_64KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>64KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_8KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>8KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DISABLED" class="tsd-kind-icon">DISABLED</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#SHARED_COMPRESSOR" class="tsd-kind-icon">SHARED_<wbr>COMPRESSOR</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#App" class="tsd-kind-icon">App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#SSLApp" class="tsd-kind-icon">SSLApp</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#getParts" class="tsd-kind-icon">get<wbr>Parts</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_socket_local_port" class="tsd-kind-icon">us_<wbr>socket_<wbr>local_<wbr>port</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="with-border-bottom">
|
||||
<div class="container">
|
||||
<h2>Legend</h2>
|
||||
<div class="tsd-legend-group">
|
||||
<ul class="tsd-legend">
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="container tsd-generator">
|
||||
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
||||
</div>
|
||||
<div class="overlay"></div>
|
||||
<script src="../assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>HttpRequest | uWebSockets.js v20.4.0 documentation</title><meta name="description" content="Documentation for uWebSockets.js v20.4.0 documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">uWebSockets.js v20.4.0 documentation</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../index.html">uWebSockets.js v20.4.0 documentation</a></li><li><a href="HttpRequest.html">HttpRequest</a></li></ul><h1>Interface HttpRequest</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>An HttpRequest is stack allocated and only accessible during the callback invocation.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">HttpRequest</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#forEach" class="tsd-kind-icon">for<wbr/>Each</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getHeader" class="tsd-kind-icon">get<wbr/>Header</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getMethod" class="tsd-kind-icon">get<wbr/>Method</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getParameter" class="tsd-kind-icon">get<wbr/>Parameter</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getQuery" class="tsd-kind-icon">get<wbr/>Query</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getUrl" class="tsd-kind-icon">get<wbr/>Url</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#setYield" class="tsd-kind-icon">set<wbr/>Yield</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="forEach" class="tsd-anchor"></a><h3>for<wbr/>Each</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">for<wbr/>Each<span class="tsd-signature-symbol">(</span>cb<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L210">index.d.ts:210</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Loops over all headers.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>cb: <span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>key: <span class="tsd-signature-type">string</span></h5></li><li><h5>value: <span class="tsd-signature-type">string</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getHeader" class="tsd-anchor"></a><h3>get<wbr/>Header</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Header<span class="tsd-signature-symbol">(</span>lowerCaseKey<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L198">index.d.ts:198</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the lowercased header value or empty string.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>lowerCaseKey: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getMethod" class="tsd-anchor"></a><h3>get<wbr/>Method</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Method<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L204">index.d.ts:204</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the HTTP method, useful for "any" routes.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getParameter" class="tsd-anchor"></a><h3>get<wbr/>Parameter</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Parameter<span class="tsd-signature-symbol">(</span>index<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L200">index.d.ts:200</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the parsed parameter at index. Corresponds to route.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>index: <span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getQuery" class="tsd-anchor"></a><h3>get<wbr/>Query</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Query<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li><li class="tsd-signature tsd-kind-icon">get<wbr/>Query<span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L206">index.d.ts:206</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the raw querystring (the part of URL after ? sign) or empty string.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L208">index.d.ts:208</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns a decoded query parameter value or empty string.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>key: <span class="tsd-signature-type">string</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getUrl" class="tsd-anchor"></a><h3>get<wbr/>Url</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Url<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L202">index.d.ts:202</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the URL including initial /slash</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="setYield" class="tsd-anchor"></a><h3>set<wbr/>Yield</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">set<wbr/>Yield<span class="tsd-signature-symbol">(</span>yield<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpRequest.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpRequest</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L212">index.d.ts:212</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Setting yield to true is to say that this route handler did not handle the route, causing the router to continue looking for a matching route handler, or fail.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>yield: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="HttpRequest.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpRequest</a></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="HttpRequest.html" class="tsd-kind-icon">Http<wbr/>Request</a><ul><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#forEach" class="tsd-kind-icon">for<wbr/>Each</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getHeader" class="tsd-kind-icon">get<wbr/>Header</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getMethod" class="tsd-kind-icon">get<wbr/>Method</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getParameter" class="tsd-kind-icon">get<wbr/>Parameter</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getQuery" class="tsd-kind-icon">get<wbr/>Query</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#getUrl" class="tsd-kind-icon">get<wbr/>Url</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpRequest.html#setYield" class="tsd-kind-icon">set<wbr/>Yield</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
@ -1,819 +1,62 @@
|
||||
<!doctype html>
|
||||
<html class="default no-js">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>HttpResponse | uWebSockets.js v19.3.0 documentation</title>
|
||||
<meta name="description" content="Documentation for uWebSockets.js v19.3.0 documentation">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../assets/css/main.css">
|
||||
<script async src="../assets/js/search.js" id="search-script"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="tsd-page-toolbar">
|
||||
<div class="container">
|
||||
<div class="table-wrap">
|
||||
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
||||
<div class="field">
|
||||
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
||||
<input id="tsd-search-field" type="text" />
|
||||
</div>
|
||||
<ul class="results">
|
||||
<li class="state loading">Preparing search index...</li>
|
||||
<li class="state failure">The search index is not available</li>
|
||||
</ul>
|
||||
<a href="../index.html" class="title">uWebSockets.js v19.3.0 documentation</a>
|
||||
</div>
|
||||
<div class="table-cell" id="tsd-widgets">
|
||||
<div id="tsd-filter">
|
||||
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
||||
<div class="tsd-filter-group">
|
||||
<div class="tsd-select" id="tsd-filter-visibility">
|
||||
<span class="tsd-select-label">All</span>
|
||||
<ul class="tsd-select-list">
|
||||
<li data-value="public">Public</li>
|
||||
<li data-value="protected">Public/Protected</li>
|
||||
<li data-value="private" class="selected">All</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="checkbox" id="tsd-filter-inherited" checked />
|
||||
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tsd-page-title">
|
||||
<div class="container">
|
||||
<ul class="tsd-breadcrumb">
|
||||
<li>
|
||||
<a href="../index.html">uWebSockets.js v19.3.0 documentation</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="HttpResponse.html">HttpResponse</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h1>Interface HttpResponse</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container container-main">
|
||||
<div class="row">
|
||||
<div class="col-8 col-content">
|
||||
<section class="tsd-panel tsd-comment">
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>An HttpResponse is valid until either onAborted callback or any of the .end/.tryEnd calls succeed. You may attach user data to this object.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-hierarchy">
|
||||
<h3>Hierarchy</h3>
|
||||
<ul class="tsd-hierarchy">
|
||||
<li>
|
||||
<span class="target">HttpResponse</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-kind-interface">
|
||||
<h3 class="tsd-before-signature">Indexable</h3>
|
||||
<div class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">[</span>key: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><span class="tsd-signature-type">any</span></div>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Arbitrary user data may be attached to this object</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel-group tsd-index-group">
|
||||
<h2>Index</h2>
|
||||
<section class="tsd-panel tsd-index-panel">
|
||||
<div class="tsd-index-content">
|
||||
<section class="tsd-index-section ">
|
||||
<h3>Methods</h3>
|
||||
<ul class="tsd-index-list">
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#close" class="tsd-kind-icon">close</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#cork" class="tsd-kind-icon">cork</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#end" class="tsd-kind-icon">end</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getProxiedRemoteAddress" class="tsd-kind-icon">get<wbr>Proxied<wbr>Remote<wbr>Address</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getProxiedRemoteAddressAsText" class="tsd-kind-icon">get<wbr>Proxied<wbr>Remote<wbr>Address<wbr>AsText</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getRemoteAddress" class="tsd-kind-icon">get<wbr>Remote<wbr>Address</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getRemoteAddressAsText" class="tsd-kind-icon">get<wbr>Remote<wbr>Address<wbr>AsText</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getWriteOffset" class="tsd-kind-icon">get<wbr>Write<wbr>Offset</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#onAborted" class="tsd-kind-icon">on<wbr>Aborted</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#onData" class="tsd-kind-icon">on<wbr>Data</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#onWritable" class="tsd-kind-icon">on<wbr>Writable</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#tryEnd" class="tsd-kind-icon">try<wbr>End</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter"><a href="HttpResponse.html#upgrade" class="tsd-kind-icon">upgrade</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#write" class="tsd-kind-icon">write</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#writeHeader" class="tsd-kind-icon">write<wbr>Header</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#writeStatus" class="tsd-kind-icon">write<wbr>Status</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section class="tsd-panel-group tsd-member-group ">
|
||||
<h2>Methods</h2>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="close" class="tsd-anchor"></a>
|
||||
<h3>close</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">close<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L154">index.d.ts:154</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Immediately force closes the connection. Any onAborted callback will run.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="cork" class="tsd-anchor"></a>
|
||||
<h3>cork</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">cork<span class="tsd-signature-symbol">(</span>cb<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L199">index.d.ts:199</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Corking a response is a performance improvement in both CPU and network, as you ready the IO system for writing multiple chunks at once.
|
||||
By default, you're corked in the immediately executing top portion of the route handler. In all other cases, such as when returning from
|
||||
await, or when being called back from an async database request or anything that isn't directly executing in the route handler, you'll want
|
||||
to cork before calling writeStatus, writeHeader or just write. Corking takes a callback in which you execute the writeHeader, writeStatus and
|
||||
such calls, in one atomic IO operation. This is important, not only for TCP but definitely for TLS where each write would otherwise result
|
||||
in one TLS block being sent off, each with one send syscall.</p>
|
||||
</div>
|
||||
<p>Example usage:</p>
|
||||
<p>res.cork(() => {
|
||||
res.writeStatus("200 OK").writeHeader("Some", "Value").write("Hello world!");
|
||||
});</p>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>cb: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5>
|
||||
<ul class="tsd-parameters">
|
||||
<li class="tsd-parameter-signature">
|
||||
<ul class="tsd-signatures tsd-kind-type-literal">
|
||||
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="end" class="tsd-anchor"></a>
|
||||
<h3>end</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">end<span class="tsd-signature-symbol">(</span>body<span class="tsd-signature-symbol">?: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, closeConnection<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L149">index.d.ts:149</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Ends this response by copying the contents of body.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5><span class="tsd-flag ts-flagOptional">Optional</span> body: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5><span class="tsd-flag ts-flagOptional">Optional</span> closeConnection: <span class="tsd-signature-type">boolean</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getProxiedRemoteAddress" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Proxied<wbr>Remote<wbr>Address</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Proxied<wbr>Remote<wbr>Address<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L181">index.d.ts:181</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the remote IP address in binary format (4 or 16 bytes), as reported by the PROXY Protocol v2 compatible proxy.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getProxiedRemoteAddressAsText" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Proxied<wbr>Remote<wbr>Address<wbr>AsText</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Proxied<wbr>Remote<wbr>Address<wbr>AsText<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L184">index.d.ts:184</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the remote IP address as text, as reported by the PROXY Protocol v2 compatible proxy.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getRemoteAddress" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Remote<wbr>Address</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Remote<wbr>Address<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L175">index.d.ts:175</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the remote IP address in binary format (4 or 16 bytes).</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getRemoteAddressAsText" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Remote<wbr>Address<wbr>AsText</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Remote<wbr>Address<wbr>AsText<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L178">index.d.ts:178</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the remote IP address as text.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getWriteOffset" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Write<wbr>Offset</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Write<wbr>Offset<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L157">index.d.ts:157</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the global byte write offset for this response. Use with onWritable.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="onAborted" class="tsd-anchor"></a>
|
||||
<h3>on<wbr>Aborted</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">on<wbr>Aborted<span class="tsd-signature-symbol">(</span>handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L169">index.d.ts:169</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Every HttpResponse MUST have an attached abort handler IF you do not respond
|
||||
to it immediately inside of the callback. Returning from an Http request handler
|
||||
without attaching (by calling onAborted) an abort handler is ill-use and will termiante.
|
||||
When this event emits, the response has been aborted and may not be used.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>handler: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5>
|
||||
<ul class="tsd-parameters">
|
||||
<li class="tsd-parameter-signature">
|
||||
<ul class="tsd-signatures tsd-kind-type-literal">
|
||||
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="onData" class="tsd-anchor"></a>
|
||||
<h3>on<wbr>Data</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">on<wbr>Data<span class="tsd-signature-symbol">(</span>handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>chunk<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span>, isLast<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L172">index.d.ts:172</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Handler for reading data from POST and such requests. You MUST copy the data of chunk if isLast is not true. We Neuter ArrayBuffers on return, making it zero length.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>handler: <span class="tsd-signature-symbol">(</span>chunk<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span>, isLast<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5>
|
||||
<ul class="tsd-parameters">
|
||||
<li class="tsd-parameter-signature">
|
||||
<ul class="tsd-signatures tsd-kind-type-literal">
|
||||
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>chunk<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span>, isLast<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>chunk: <span class="tsd-signature-type">ArrayBuffer</span></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>isLast: <span class="tsd-signature-type">boolean</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="onWritable" class="tsd-anchor"></a>
|
||||
<h3>on<wbr>Writable</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">on<wbr>Writable<span class="tsd-signature-symbol">(</span>handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>offset<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L163">index.d.ts:163</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Registers a handler for writable events. Continue failed write attempts in here.
|
||||
You MUST return true for success, false for failure.
|
||||
Writing nothing is always success, so by default you must return true.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>handler: <span class="tsd-signature-symbol">(</span>offset<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span></h5>
|
||||
<ul class="tsd-parameters">
|
||||
<li class="tsd-parameter-signature">
|
||||
<ul class="tsd-signatures tsd-kind-type-literal">
|
||||
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>offset<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>offset: <span class="tsd-signature-type">number</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="tryEnd" class="tsd-anchor"></a>
|
||||
<h3>try<wbr>End</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">try<wbr>End<span class="tsd-signature-symbol">(</span>fullBodyOrChunk<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, totalSize<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">]</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L151">index.d.ts:151</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Ends this response, or tries to, by streaming appropriately sized chunks of body. Use in conjunction with onWritable. Returns tuple [ok, hasResponded].</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>fullBodyOrChunk: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>totalSize: <span class="tsd-signature-type">number</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">]</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter">
|
||||
<a name="upgrade" class="tsd-anchor"></a>
|
||||
<h3>upgrade</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter">
|
||||
<li class="tsd-signature tsd-kind-icon">upgrade<T><span class="tsd-signature-symbol">(</span>userData<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">T</span>, secWebSocketKey<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, secWebSocketProtocol<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, secWebSocketExtensions<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, context<span class="tsd-signature-symbol">: </span><a href="us_socket_context_t.html" class="tsd-signature-type" data-tsd-kind="Interface">us_socket_context_t</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L202">index.d.ts:202</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Upgrades a HttpResponse to a WebSocket. See UpgradeAsync, UpgradeSync example files.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-type-parameters-title">Type parameters</h4>
|
||||
<ul class="tsd-type-parameters">
|
||||
<li>
|
||||
<h4>T</h4>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>userData: <span class="tsd-signature-type">T</span></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>secWebSocketKey: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>secWebSocketProtocol: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>secWebSocketExtensions: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>context: <a href="us_socket_context_t.html" class="tsd-signature-type" data-tsd-kind="Interface">us_socket_context_t</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="write" class="tsd-anchor"></a>
|
||||
<h3>write</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">write<span class="tsd-signature-symbol">(</span>chunk<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L147">index.d.ts:147</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Enters or continues chunked encoding mode. Writes part of the response. End with zero length write.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>chunk: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="writeHeader" class="tsd-anchor"></a>
|
||||
<h3>write<wbr>Header</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">write<wbr>Header<span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, value<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L145">index.d.ts:145</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Writes key and value to HTTP response.
|
||||
See writeStatus and corking.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>key: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>value: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="writeStatus" class="tsd-anchor"></a>
|
||||
<h3>write<wbr>Status</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">write<wbr>Status<span class="tsd-signature-symbol">(</span>status<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L141">index.d.ts:141</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Writes the HTTP status message such as "200 OK".
|
||||
This has to be called first in any response, otherwise
|
||||
it will be called automatically with "200 OK".</p>
|
||||
</div>
|
||||
<p>If you want to send custom headers in a WebSocket
|
||||
upgrade response, you have to call writeStatus with
|
||||
"101 Switching Protocols" before you call writeHeader,
|
||||
otherwise your first call to writeHeader will call
|
||||
writeStatus with "200 OK" and the upgrade will fail.</p>
|
||||
<p>As you can imagine, we format outgoing responses in a linear
|
||||
buffer, not in a hash table. You can read about this in
|
||||
the user manual under "corking".</p>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>status: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
||||
<nav class="tsd-navigation primary">
|
||||
<ul>
|
||||
<li class=" ">
|
||||
<a href="../index.html">Exports</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav class="tsd-navigation secondary menu-sticky">
|
||||
<ul class="before-current">
|
||||
<li class=" tsd-kind-enum">
|
||||
<a href="../enums/ListenOptions.html" class="tsd-kind-icon">Listen<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="AppOptions.html" class="tsd-kind-icon">App<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpRequest.html" class="tsd-kind-icon">Http<wbr>Request</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="current">
|
||||
<li class="current tsd-kind-interface">
|
||||
<a href="HttpResponse.html" class="tsd-kind-icon">Http<wbr>Response</a>
|
||||
<ul>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#close" class="tsd-kind-icon">close</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#cork" class="tsd-kind-icon">cork</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#end" class="tsd-kind-icon">end</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#getProxiedRemoteAddress" class="tsd-kind-icon">get<wbr>Proxied<wbr>Remote<wbr>Address</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#getProxiedRemoteAddressAsText" class="tsd-kind-icon">get<wbr>Proxied<wbr>Remote<wbr>Address<wbr>AsText</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#getRemoteAddress" class="tsd-kind-icon">get<wbr>Remote<wbr>Address</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#getRemoteAddressAsText" class="tsd-kind-icon">get<wbr>Remote<wbr>Address<wbr>AsText</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#getWriteOffset" class="tsd-kind-icon">get<wbr>Write<wbr>Offset</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#onAborted" class="tsd-kind-icon">on<wbr>Aborted</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#onData" class="tsd-kind-icon">on<wbr>Data</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#onWritable" class="tsd-kind-icon">on<wbr>Writable</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#tryEnd" class="tsd-kind-icon">try<wbr>End</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter">
|
||||
<a href="HttpResponse.html#upgrade" class="tsd-kind-icon">upgrade</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#write" class="tsd-kind-icon">write</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#writeHeader" class="tsd-kind-icon">write<wbr>Header</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="HttpResponse.html#writeStatus" class="tsd-kind-icon">write<wbr>Status</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="after-current">
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="MultipartField.html" class="tsd-kind-icon">Multipart<wbr>Field</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="TemplatedApp.html" class="tsd-kind-icon">Templated<wbr>App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocketBehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket.html" class="tsd-kind-icon">us_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket_context_t.html" class="tsd-kind-icon">us_<wbr>socket_<wbr>context_<wbr>t</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#CompressOptions" class="tsd-kind-icon">Compress<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#RecognizedString" class="tsd-kind-icon">Recognized<wbr>String</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_128KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>128KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_16KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>16KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_256KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>256KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_32KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>32KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_3KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>3KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_4KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>4KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_64KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>64KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_8KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>8KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DISABLED" class="tsd-kind-icon">DISABLED</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#SHARED_COMPRESSOR" class="tsd-kind-icon">SHARED_<wbr>COMPRESSOR</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#App" class="tsd-kind-icon">App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#SSLApp" class="tsd-kind-icon">SSLApp</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#getParts" class="tsd-kind-icon">get<wbr>Parts</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_socket_local_port" class="tsd-kind-icon">us_<wbr>socket_<wbr>local_<wbr>port</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="with-border-bottom">
|
||||
<div class="container">
|
||||
<h2>Legend</h2>
|
||||
<div class="tsd-legend-group">
|
||||
<ul class="tsd-legend">
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="container tsd-generator">
|
||||
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
||||
</div>
|
||||
<div class="overlay"></div>
|
||||
<script src="../assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>HttpResponse | uWebSockets.js v20.4.0 documentation</title><meta name="description" content="Documentation for uWebSockets.js v20.4.0 documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">uWebSockets.js v20.4.0 documentation</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../index.html">uWebSockets.js v20.4.0 documentation</a></li><li><a href="HttpResponse.html">HttpResponse</a></li></ul><h1>Interface HttpResponse</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>An HttpResponse is valid until either onAborted callback or any of the .end/.tryEnd calls succeed. You may attach user data to this object.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">HttpResponse</span></li></ul></section><section class="tsd-panel tsd-kind-interface"><h3 class="tsd-before-signature">Indexable</h3><div class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">[</span>key: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><span class="tsd-signature-type">any</span></div><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Arbitrary user data may be attached to this object</p>
|
||||
</div></div></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#close" class="tsd-kind-icon">close</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#cork" class="tsd-kind-icon">cork</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#end" class="tsd-kind-icon">end</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getProxiedRemoteAddress" class="tsd-kind-icon">get<wbr/>Proxied<wbr/>Remote<wbr/>Address</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getProxiedRemoteAddressAsText" class="tsd-kind-icon">get<wbr/>Proxied<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getRemoteAddress" class="tsd-kind-icon">get<wbr/>Remote<wbr/>Address</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getRemoteAddressAsText" class="tsd-kind-icon">get<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getWriteOffset" class="tsd-kind-icon">get<wbr/>Write<wbr/>Offset</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#onAborted" class="tsd-kind-icon">on<wbr/>Aborted</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#onData" class="tsd-kind-icon">on<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#onWritable" class="tsd-kind-icon">on<wbr/>Writable</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#tryEnd" class="tsd-kind-icon">try<wbr/>End</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter"><a href="HttpResponse.html#upgrade" class="tsd-kind-icon">upgrade</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#write" class="tsd-kind-icon">write</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#writeHeader" class="tsd-kind-icon">write<wbr/>Header</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#writeStatus" class="tsd-kind-icon">write<wbr/>Status</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="close" class="tsd-anchor"></a><h3>close</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">close<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L141">index.d.ts:141</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Immediately force closes the connection. Any onAborted callback will run.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="cork" class="tsd-anchor"></a><h3>cork</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">cork<span class="tsd-signature-symbol">(</span>cb<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L186">index.d.ts:186</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Corking a response is a performance improvement in both CPU and network, as you ready the IO system for writing multiple chunks at once.
|
||||
By default, you're corked in the immediately executing top portion of the route handler. In all other cases, such as when returning from
|
||||
await, or when being called back from an async database request or anything that isn't directly executing in the route handler, you'll want
|
||||
to cork before calling writeStatus, writeHeader or just write. Corking takes a callback in which you execute the writeHeader, writeStatus and
|
||||
such calls, in one atomic IO operation. This is important, not only for TCP but definitely for TLS where each write would otherwise result
|
||||
in one TLS block being sent off, each with one send syscall.</p>
|
||||
</div><div><p>Example usage:</p>
|
||||
<p>res.cork(() => {
|
||||
res.writeStatus("200 OK").writeHeader("Some", "Value").write("Hello world!");
|
||||
});</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>cb: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="end" class="tsd-anchor"></a><h3>end</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">end<span class="tsd-signature-symbol">(</span>body<span class="tsd-signature-symbol">?: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, closeConnection<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L136">index.d.ts:136</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Ends this response by copying the contents of body.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> body: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> closeConnection: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getProxiedRemoteAddress" class="tsd-anchor"></a><h3>get<wbr/>Proxied<wbr/>Remote<wbr/>Address</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Proxied<wbr/>Remote<wbr/>Address<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L168">index.d.ts:168</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the remote IP address in binary format (4 or 16 bytes), as reported by the PROXY Protocol v2 compatible proxy.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getProxiedRemoteAddressAsText" class="tsd-anchor"></a><h3>get<wbr/>Proxied<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Proxied<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L171">index.d.ts:171</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the remote IP address as text, as reported by the PROXY Protocol v2 compatible proxy.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getRemoteAddress" class="tsd-anchor"></a><h3>get<wbr/>Remote<wbr/>Address</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Remote<wbr/>Address<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L162">index.d.ts:162</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the remote IP address in binary format (4 or 16 bytes).</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getRemoteAddressAsText" class="tsd-anchor"></a><h3>get<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L165">index.d.ts:165</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the remote IP address as text.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getWriteOffset" class="tsd-anchor"></a><h3>get<wbr/>Write<wbr/>Offset</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Write<wbr/>Offset<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L144">index.d.ts:144</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the global byte write offset for this response. Use with onWritable.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="onAborted" class="tsd-anchor"></a><h3>on<wbr/>Aborted</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">on<wbr/>Aborted<span class="tsd-signature-symbol">(</span>handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L156">index.d.ts:156</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Every HttpResponse MUST have an attached abort handler IF you do not respond
|
||||
to it immediately inside of the callback. Returning from an Http request handler
|
||||
without attaching (by calling onAborted) an abort handler is ill-use and will termiante.
|
||||
When this event emits, the response has been aborted and may not be used.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>handler: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="onData" class="tsd-anchor"></a><h3>on<wbr/>Data</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">on<wbr/>Data<span class="tsd-signature-symbol">(</span>handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>chunk<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span>, isLast<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L159">index.d.ts:159</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Handler for reading data from POST and such requests. You MUST copy the data of chunk if isLast is not true. We Neuter ArrayBuffers on return, making it zero length.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>handler: <span class="tsd-signature-symbol">(</span>chunk<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span>, isLast<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>chunk<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span>, isLast<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>chunk: <span class="tsd-signature-type">ArrayBuffer</span></h5></li><li><h5>isLast: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="onWritable" class="tsd-anchor"></a><h3>on<wbr/>Writable</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">on<wbr/>Writable<span class="tsd-signature-symbol">(</span>handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>offset<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L150">index.d.ts:150</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Registers a handler for writable events. Continue failed write attempts in here.
|
||||
You MUST return true for success, false for failure.
|
||||
Writing nothing is always success, so by default you must return true.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>handler: <span class="tsd-signature-symbol">(</span>offset<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>offset<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>offset: <span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="tryEnd" class="tsd-anchor"></a><h3>try<wbr/>End</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">try<wbr/>End<span class="tsd-signature-symbol">(</span>fullBodyOrChunk<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, totalSize<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">]</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L138">index.d.ts:138</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Ends this response, or tries to, by streaming appropriately sized chunks of body. Use in conjunction with onWritable. Returns tuple [ok, hasResponded].</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>fullBodyOrChunk: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li><li><h5>totalSize: <span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">]</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter"><a id="upgrade" class="tsd-anchor"></a><h3>upgrade</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">upgrade<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>userData<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span>, secWebSocketKey<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, secWebSocketProtocol<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, secWebSocketExtensions<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, context<span class="tsd-signature-symbol">: </span><a href="us_socket_context_t.html" class="tsd-signature-type" data-tsd-kind="Interface">us_socket_context_t</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L189">index.d.ts:189</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Upgrades a HttpResponse to a WebSocket. See UpgradeAsync, UpgradeSync example files.</p>
|
||||
</div></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>T</h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>userData: <span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span></h5></li><li><h5>secWebSocketKey: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li><li><h5>secWebSocketProtocol: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li><li><h5>secWebSocketExtensions: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li><li><h5>context: <a href="us_socket_context_t.html" class="tsd-signature-type" data-tsd-kind="Interface">us_socket_context_t</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="write" class="tsd-anchor"></a><h3>write</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">write<span class="tsd-signature-symbol">(</span>chunk<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L134">index.d.ts:134</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Enters or continues chunked encoding mode. Writes part of the response. End with zero length write. Returns true if no backpressure was added.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>chunk: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="writeHeader" class="tsd-anchor"></a><h3>write<wbr/>Header</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">write<wbr/>Header<span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, value<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L132">index.d.ts:132</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Writes key and value to HTTP response.
|
||||
See writeStatus and corking.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>key: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li><li><h5>value: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="writeStatus" class="tsd-anchor"></a><h3>write<wbr/>Status</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">write<wbr/>Status<span class="tsd-signature-symbol">(</span>status<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L128">index.d.ts:128</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Writes the HTTP status message such as "200 OK".
|
||||
This has to be called first in any response, otherwise
|
||||
it will be called automatically with "200 OK".</p>
|
||||
</div><div><p>If you want to send custom headers in a WebSocket
|
||||
upgrade response, you have to call writeStatus with
|
||||
"101 Switching Protocols" before you call writeHeader,
|
||||
otherwise your first call to writeHeader will call
|
||||
writeStatus with "200 OK" and the upgrade will fail.</p>
|
||||
<p>As you can imagine, we format outgoing responses in a linear
|
||||
buffer, not in a hash table. You can read about this in
|
||||
the user manual under "corking".</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>status: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="HttpResponse.html" class="tsd-kind-icon">Http<wbr/>Response</a><ul><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#close" class="tsd-kind-icon">close</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#cork" class="tsd-kind-icon">cork</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#end" class="tsd-kind-icon">end</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getProxiedRemoteAddress" class="tsd-kind-icon">get<wbr/>Proxied<wbr/>Remote<wbr/>Address</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getProxiedRemoteAddressAsText" class="tsd-kind-icon">get<wbr/>Proxied<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getRemoteAddress" class="tsd-kind-icon">get<wbr/>Remote<wbr/>Address</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getRemoteAddressAsText" class="tsd-kind-icon">get<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#getWriteOffset" class="tsd-kind-icon">get<wbr/>Write<wbr/>Offset</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#onAborted" class="tsd-kind-icon">on<wbr/>Aborted</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#onData" class="tsd-kind-icon">on<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#onWritable" class="tsd-kind-icon">on<wbr/>Writable</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#tryEnd" class="tsd-kind-icon">try<wbr/>End</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter"><a href="HttpResponse.html#upgrade" class="tsd-kind-icon">upgrade</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#write" class="tsd-kind-icon">write</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#writeHeader" class="tsd-kind-icon">write<wbr/>Header</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="HttpResponse.html#writeStatus" class="tsd-kind-icon">write<wbr/>Status</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
@ -1,661 +1,41 @@
|
||||
<!doctype html>
|
||||
<html class="default no-js">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>WebSocket | uWebSockets.js v19.3.0 documentation</title>
|
||||
<meta name="description" content="Documentation for uWebSockets.js v19.3.0 documentation">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../assets/css/main.css">
|
||||
<script async src="../assets/js/search.js" id="search-script"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="tsd-page-toolbar">
|
||||
<div class="container">
|
||||
<div class="table-wrap">
|
||||
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
||||
<div class="field">
|
||||
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
||||
<input id="tsd-search-field" type="text" />
|
||||
</div>
|
||||
<ul class="results">
|
||||
<li class="state loading">Preparing search index...</li>
|
||||
<li class="state failure">The search index is not available</li>
|
||||
</ul>
|
||||
<a href="../index.html" class="title">uWebSockets.js v19.3.0 documentation</a>
|
||||
</div>
|
||||
<div class="table-cell" id="tsd-widgets">
|
||||
<div id="tsd-filter">
|
||||
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
||||
<div class="tsd-filter-group">
|
||||
<div class="tsd-select" id="tsd-filter-visibility">
|
||||
<span class="tsd-select-label">All</span>
|
||||
<ul class="tsd-select-list">
|
||||
<li data-value="public">Public</li>
|
||||
<li data-value="protected">Public/Protected</li>
|
||||
<li data-value="private" class="selected">All</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="checkbox" id="tsd-filter-inherited" checked />
|
||||
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tsd-page-title">
|
||||
<div class="container">
|
||||
<ul class="tsd-breadcrumb">
|
||||
<li>
|
||||
<a href="../index.html">uWebSockets.js v19.3.0 documentation</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="WebSocket.html">WebSocket</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h1>Interface WebSocket</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container container-main">
|
||||
<div class="row">
|
||||
<div class="col-8 col-content">
|
||||
<section class="tsd-panel tsd-comment">
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>A WebSocket connection that is valid from open to close event.
|
||||
Read more about this in the user manual.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-hierarchy">
|
||||
<h3>Hierarchy</h3>
|
||||
<ul class="tsd-hierarchy">
|
||||
<li>
|
||||
<span class="target">WebSocket</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-kind-interface">
|
||||
<h3 class="tsd-before-signature">Indexable</h3>
|
||||
<div class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">[</span>key: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><span class="tsd-signature-type">any</span></div>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Arbitrary user data may be attached to this object. In C++ this is done by using getUserData().</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel-group tsd-index-group">
|
||||
<h2>Index</h2>
|
||||
<section class="tsd-panel tsd-index-panel">
|
||||
<div class="tsd-index-content">
|
||||
<section class="tsd-index-section ">
|
||||
<h3>Methods</h3>
|
||||
<ul class="tsd-index-list">
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#close" class="tsd-kind-icon">close</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#cork" class="tsd-kind-icon">cork</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#end" class="tsd-kind-icon">end</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getBufferedAmount" class="tsd-kind-icon">get<wbr>Buffered<wbr>Amount</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getRemoteAddress" class="tsd-kind-icon">get<wbr>Remote<wbr>Address</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getRemoteAddressAsText" class="tsd-kind-icon">get<wbr>Remote<wbr>Address<wbr>AsText</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getTopics" class="tsd-kind-icon">get<wbr>Topics</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#isSubscribed" class="tsd-kind-icon">is<wbr>Subscribed</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#ping" class="tsd-kind-icon">ping</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#publish" class="tsd-kind-icon">publish</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#send" class="tsd-kind-icon">send</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#subscribe" class="tsd-kind-icon">subscribe</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#unsubscribe" class="tsd-kind-icon">unsubscribe</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section class="tsd-panel-group tsd-member-group ">
|
||||
<h2>Methods</h2>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="close" class="tsd-anchor"></a>
|
||||
<h3>close</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">close<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L71">index.d.ts:71</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Forcefully closes this WebSocket. Immediately calls the close handler.
|
||||
No WebSocket close message is sent.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="cork" class="tsd-anchor"></a>
|
||||
<h3>cork</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">cork<span class="tsd-signature-symbol">(</span>cb<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L107">index.d.ts:107</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>See HttpResponse.cork. Takes a function in which the socket is corked (packing many sends into one single syscall/SSL block)</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>cb: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5>
|
||||
<ul class="tsd-parameters">
|
||||
<li class="tsd-parameter-signature">
|
||||
<ul class="tsd-signatures tsd-kind-type-literal">
|
||||
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="end" class="tsd-anchor"></a>
|
||||
<h3>end</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">end<span class="tsd-signature-symbol">(</span>code<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, shortMessage<span class="tsd-signature-symbol">?: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L66">index.d.ts:66</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Gracefully closes this WebSocket. Immediately calls the close handler.
|
||||
A WebSocket close message is sent with code and shortMessage.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5><span class="tsd-flag ts-flagOptional">Optional</span> code: <span class="tsd-signature-type">number</span></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5><span class="tsd-flag ts-flagOptional">Optional</span> shortMessage: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getBufferedAmount" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Buffered<wbr>Amount</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Buffered<wbr>Amount<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L61">index.d.ts:61</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the bytes buffered in backpressure. This is similar to the bufferedAmount property in the browser counterpart.
|
||||
Check backpressure example.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getRemoteAddress" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Remote<wbr>Address</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Remote<wbr>Address<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L116">index.d.ts:116</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the remote IP address. Note that the returned IP is binary, not text.</p>
|
||||
</div>
|
||||
<p>IPv4 is 4 byte long and can be converted to text by printing every byte as a digit between 0 and 255.
|
||||
IPv6 is 16 byte long and can be converted to text in similar ways, but you typically print digits in HEX.</p>
|
||||
<p>See getRemoteAddressAsText() for a text version.</p>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getRemoteAddressAsText" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Remote<wbr>Address<wbr>AsText</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Remote<wbr>Address<wbr>AsText<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L119">index.d.ts:119</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns the remote IP address as text. See RecognizedString.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="getTopics" class="tsd-anchor"></a>
|
||||
<h3>get<wbr>Topics</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">get<wbr>Topics<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L92">index.d.ts:92</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns a list of topics this websocket is subscribed to.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="isSubscribed" class="tsd-anchor"></a>
|
||||
<h3>is<wbr>Subscribed</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">is<wbr>Subscribed<span class="tsd-signature-symbol">(</span>topic<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L89">index.d.ts:89</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Returns whether this websocket is subscribed to topic.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>topic: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="ping" class="tsd-anchor"></a>
|
||||
<h3>ping</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">ping<span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">?: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L74">index.d.ts:74</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Sends a ping control message. Returns true on success in similar ways as WebSocket.send does (regarding backpressure). This helper function correlates to WebSocket::send(message, uWS::OpCode::PING, ...) in C++.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5><span class="tsd-flag ts-flagOptional">Optional</span> message: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="publish" class="tsd-anchor"></a>
|
||||
<h3>publish</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">publish<span class="tsd-signature-symbol">(</span>topic<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, message<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, isBinary<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, compress<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L104">index.d.ts:104</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Publish a message to a topic in MQTT syntax. You cannot publish using wildcards, only fully specified topics. Just like with MQTT.</p>
|
||||
</div>
|
||||
<p>"parent/child" kind of tree is allowed, but not "parent/#" kind of wildcard publishing.</p>
|
||||
<p>The pub/sub system does not guarantee order between what you manually send using WebSocket.send
|
||||
and what you publish using WebSocket.publish. WebSocket messages are perfectly atomic, but the order in which they appear can get scrambled if you mix the two sending functions on the same socket.
|
||||
This shouldn't matter in most applications. Order is guaranteed relative to other calls to WebSocket.publish.</p>
|
||||
<p>Also keep in mind that backpressure will be automatically managed with pub/sub, meaning some outgoing messages may be dropped if backpressure is greater than specified maxBackpressure.</p>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>topic: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>message: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5><span class="tsd-flag ts-flagOptional">Optional</span> isBinary: <span class="tsd-signature-type">boolean</span></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5><span class="tsd-flag ts-flagOptional">Optional</span> compress: <span class="tsd-signature-type">boolean</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="send" class="tsd-anchor"></a>
|
||||
<h3>send</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">send<span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, isBinary<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, compress<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L56">index.d.ts:56</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Sends a message. Make sure to check getBufferedAmount() before sending. Returns true for success, false for built up backpressure that will drain when time is given.
|
||||
Returning false does not mean nothing was sent, it only means backpressure was built up. This you can check by calling getBufferedAmount() afterwards.</p>
|
||||
</div>
|
||||
<p>Make sure you properly understand the concept of backpressure. Check the backpressure example file.</p>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>message: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5><span class="tsd-flag ts-flagOptional">Optional</span> isBinary: <span class="tsd-signature-type">boolean</span></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5><span class="tsd-flag ts-flagOptional">Optional</span> compress: <span class="tsd-signature-type">boolean</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="subscribe" class="tsd-anchor"></a>
|
||||
<h3>subscribe</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">subscribe<span class="tsd-signature-symbol">(</span>topic<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L83">index.d.ts:83</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Subscribe to a topic in MQTT syntax.</p>
|
||||
</div>
|
||||
<p>MQTT syntax includes things like "root/child/+/grandchild" where "+" is a
|
||||
wildcard and "root/#" where "#" is a terminating wildcard.</p>
|
||||
<p>Read more about MQTT.</p>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>topic: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="unsubscribe" class="tsd-anchor"></a>
|
||||
<h3>unsubscribe</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">unsubscribe<span class="tsd-signature-symbol">(</span>topic<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L86">index.d.ts:86</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Unsubscribe from a topic. Returns true on success, if the WebSocket was subscribed.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>topic: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
||||
<nav class="tsd-navigation primary">
|
||||
<ul>
|
||||
<li class=" ">
|
||||
<a href="../index.html">Exports</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav class="tsd-navigation secondary menu-sticky">
|
||||
<ul class="before-current">
|
||||
<li class=" tsd-kind-enum">
|
||||
<a href="../enums/ListenOptions.html" class="tsd-kind-icon">Listen<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="AppOptions.html" class="tsd-kind-icon">App<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpRequest.html" class="tsd-kind-icon">Http<wbr>Request</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpResponse.html" class="tsd-kind-icon">Http<wbr>Response</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="MultipartField.html" class="tsd-kind-icon">Multipart<wbr>Field</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="TemplatedApp.html" class="tsd-kind-icon">Templated<wbr>App</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="current">
|
||||
<li class="current tsd-kind-interface">
|
||||
<a href="WebSocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
|
||||
<ul>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#close" class="tsd-kind-icon">close</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#cork" class="tsd-kind-icon">cork</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#end" class="tsd-kind-icon">end</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#getBufferedAmount" class="tsd-kind-icon">get<wbr>Buffered<wbr>Amount</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#getRemoteAddress" class="tsd-kind-icon">get<wbr>Remote<wbr>Address</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#getRemoteAddressAsText" class="tsd-kind-icon">get<wbr>Remote<wbr>Address<wbr>AsText</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#getTopics" class="tsd-kind-icon">get<wbr>Topics</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#isSubscribed" class="tsd-kind-icon">is<wbr>Subscribed</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#ping" class="tsd-kind-icon">ping</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#publish" class="tsd-kind-icon">publish</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#send" class="tsd-kind-icon">send</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#subscribe" class="tsd-kind-icon">subscribe</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocket.html#unsubscribe" class="tsd-kind-icon">unsubscribe</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="after-current">
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocketBehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket.html" class="tsd-kind-icon">us_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket_context_t.html" class="tsd-kind-icon">us_<wbr>socket_<wbr>context_<wbr>t</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#CompressOptions" class="tsd-kind-icon">Compress<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#RecognizedString" class="tsd-kind-icon">Recognized<wbr>String</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_128KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>128KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_16KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>16KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_256KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>256KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_32KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>32KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_3KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>3KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_4KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>4KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_64KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>64KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_8KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>8KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DISABLED" class="tsd-kind-icon">DISABLED</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#SHARED_COMPRESSOR" class="tsd-kind-icon">SHARED_<wbr>COMPRESSOR</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#App" class="tsd-kind-icon">App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#SSLApp" class="tsd-kind-icon">SSLApp</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#getParts" class="tsd-kind-icon">get<wbr>Parts</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_socket_local_port" class="tsd-kind-icon">us_<wbr>socket_<wbr>local_<wbr>port</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="with-border-bottom">
|
||||
<div class="container">
|
||||
<h2>Legend</h2>
|
||||
<div class="tsd-legend-group">
|
||||
<ul class="tsd-legend">
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="container tsd-generator">
|
||||
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
||||
</div>
|
||||
<div class="overlay"></div>
|
||||
<script src="../assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WebSocket | uWebSockets.js v20.4.0 documentation</title><meta name="description" content="Documentation for uWebSockets.js v20.4.0 documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">uWebSockets.js v20.4.0 documentation</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../index.html">uWebSockets.js v20.4.0 documentation</a></li><li><a href="WebSocket.html">WebSocket</a></li></ul><h1>Interface WebSocket</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>A WebSocket connection that is valid from open to close event.
|
||||
Read more about this in the user manual.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">WebSocket</span></li></ul></section><section class="tsd-panel tsd-kind-interface"><h3 class="tsd-before-signature">Indexable</h3><div class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">[</span>key: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><span class="tsd-signature-type">any</span></div><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Arbitrary user data may be attached to this object. In C++ this is done by using getUserData().</p>
|
||||
</div></div></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#close" class="tsd-kind-icon">close</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#cork" class="tsd-kind-icon">cork</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#end" class="tsd-kind-icon">end</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getBufferedAmount" class="tsd-kind-icon">get<wbr/>Buffered<wbr/>Amount</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getRemoteAddress" class="tsd-kind-icon">get<wbr/>Remote<wbr/>Address</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getRemoteAddressAsText" class="tsd-kind-icon">get<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getTopics" class="tsd-kind-icon">get<wbr/>Topics</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#isSubscribed" class="tsd-kind-icon">is<wbr/>Subscribed</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#ping" class="tsd-kind-icon">ping</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#publish" class="tsd-kind-icon">publish</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#send" class="tsd-kind-icon">send</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#subscribe" class="tsd-kind-icon">subscribe</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#unsubscribe" class="tsd-kind-icon">unsubscribe</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="close" class="tsd-anchor"></a><h3>close</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">close<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L71">index.d.ts:71</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Forcefully closes this WebSocket. Immediately calls the close handler.
|
||||
No WebSocket close message is sent.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="cork" class="tsd-anchor"></a><h3>cork</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">cork<span class="tsd-signature-symbol">(</span>cb<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L94">index.d.ts:94</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>See HttpResponse.cork. Takes a function in which the socket is corked (packing many sends into one single syscall/SSL block)</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>cb: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="end" class="tsd-anchor"></a><h3>end</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">end<span class="tsd-signature-symbol">(</span>code<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, shortMessage<span class="tsd-signature-symbol">?: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L66">index.d.ts:66</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Gracefully closes this WebSocket. Immediately calls the close handler.
|
||||
A WebSocket close message is sent with code and shortMessage.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> code: <span class="tsd-signature-type">number</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> shortMessage: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getBufferedAmount" class="tsd-anchor"></a><h3>get<wbr/>Buffered<wbr/>Amount</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Buffered<wbr/>Amount<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L61">index.d.ts:61</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the bytes buffered in backpressure. This is similar to the bufferedAmount property in the browser counterpart.
|
||||
Check backpressure example.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getRemoteAddress" class="tsd-anchor"></a><h3>get<wbr/>Remote<wbr/>Address</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Remote<wbr/>Address<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L103">index.d.ts:103</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the remote IP address. Note that the returned IP is binary, not text.</p>
|
||||
</div><div><p>IPv4 is 4 byte long and can be converted to text by printing every byte as a digit between 0 and 255.
|
||||
IPv6 is 16 byte long and can be converted to text in similar ways, but you typically print digits in HEX.</p>
|
||||
<p>See getRemoteAddressAsText() for a text version.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getRemoteAddressAsText" class="tsd-anchor"></a><h3>get<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L106">index.d.ts:106</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns the remote IP address as text. See RecognizedString.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ArrayBuffer</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getTopics" class="tsd-anchor"></a><h3>get<wbr/>Topics</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Topics<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L86">index.d.ts:86</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns a list of topics this websocket is subscribed to.</p>
|
||||
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="isSubscribed" class="tsd-anchor"></a><h3>is<wbr/>Subscribed</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">is<wbr/>Subscribed<span class="tsd-signature-symbol">(</span>topic<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L83">index.d.ts:83</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Returns whether this websocket is subscribed to topic.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>topic: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="ping" class="tsd-anchor"></a><h3>ping</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">ping<span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">?: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L74">index.d.ts:74</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Sends a ping control message. Returns true on success in similar ways as WebSocket.send does (regarding backpressure). This helper function correlates to WebSocket::send(message, uWS::OpCode::PING, ...) in C++.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> message: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="publish" class="tsd-anchor"></a><h3>publish</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">publish<span class="tsd-signature-symbol">(</span>topic<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, message<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, isBinary<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, compress<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L91">index.d.ts:91</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Publish a message under topic. Backpressure is managed according to maxBackpressure, closeOnBackpressureLimit settings.
|
||||
Order is guaranteed since v20.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>topic: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li><li><h5>message: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> isBinary: <span class="tsd-signature-type">boolean</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> compress: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="send" class="tsd-anchor"></a><h3>send</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">send<span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a>, isBinary<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, compress<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L56">index.d.ts:56</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Sends a message. Make sure to check getBufferedAmount() before sending. Returns true for success, false for built up backpressure that will drain when time is given.
|
||||
Returning false does not mean nothing was sent, it only means backpressure was built up. This you can check by calling getBufferedAmount() afterwards.</p>
|
||||
</div><div><p>Make sure you properly understand the concept of backpressure. Check the backpressure example file.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>message: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> isBinary: <span class="tsd-signature-type">boolean</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> compress: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="subscribe" class="tsd-anchor"></a><h3>subscribe</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">subscribe<span class="tsd-signature-symbol">(</span>topic<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L77">index.d.ts:77</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Subscribe to a topic.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>topic: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="unsubscribe" class="tsd-anchor"></a><h3>unsubscribe</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">unsubscribe<span class="tsd-signature-symbol">(</span>topic<span class="tsd-signature-symbol">: </span><a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L80">index.d.ts:80</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Unsubscribe from a topic. Returns true on success, if the WebSocket was subscribed.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>topic: <a href="../index.html#RecognizedString" class="tsd-signature-type" data-tsd-kind="Type alias">RecognizedString</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="WebSocket.html" class="tsd-kind-icon">Web<wbr/>Socket</a><ul><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#close" class="tsd-kind-icon">close</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#cork" class="tsd-kind-icon">cork</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#end" class="tsd-kind-icon">end</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getBufferedAmount" class="tsd-kind-icon">get<wbr/>Buffered<wbr/>Amount</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getRemoteAddress" class="tsd-kind-icon">get<wbr/>Remote<wbr/>Address</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getRemoteAddressAsText" class="tsd-kind-icon">get<wbr/>Remote<wbr/>Address<wbr/>As<wbr/>Text</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#getTopics" class="tsd-kind-icon">get<wbr/>Topics</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#isSubscribed" class="tsd-kind-icon">is<wbr/>Subscribed</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#ping" class="tsd-kind-icon">ping</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#publish" class="tsd-kind-icon">publish</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#send" class="tsd-kind-icon">send</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#subscribe" class="tsd-kind-icon">subscribe</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocket.html#unsubscribe" class="tsd-kind-icon">unsubscribe</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
@ -1,553 +1,29 @@
|
||||
<!doctype html>
|
||||
<html class="default no-js">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>WebSocketBehavior | uWebSockets.js v19.3.0 documentation</title>
|
||||
<meta name="description" content="Documentation for uWebSockets.js v19.3.0 documentation">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../assets/css/main.css">
|
||||
<script async src="../assets/js/search.js" id="search-script"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="tsd-page-toolbar">
|
||||
<div class="container">
|
||||
<div class="table-wrap">
|
||||
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
||||
<div class="field">
|
||||
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
||||
<input id="tsd-search-field" type="text" />
|
||||
</div>
|
||||
<ul class="results">
|
||||
<li class="state loading">Preparing search index...</li>
|
||||
<li class="state failure">The search index is not available</li>
|
||||
</ul>
|
||||
<a href="../index.html" class="title">uWebSockets.js v19.3.0 documentation</a>
|
||||
</div>
|
||||
<div class="table-cell" id="tsd-widgets">
|
||||
<div id="tsd-filter">
|
||||
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
||||
<div class="tsd-filter-group">
|
||||
<div class="tsd-select" id="tsd-filter-visibility">
|
||||
<span class="tsd-select-label">All</span>
|
||||
<ul class="tsd-select-list">
|
||||
<li data-value="public">Public</li>
|
||||
<li data-value="protected">Public/Protected</li>
|
||||
<li data-value="private" class="selected">All</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="checkbox" id="tsd-filter-inherited" checked />
|
||||
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tsd-page-title">
|
||||
<div class="container">
|
||||
<ul class="tsd-breadcrumb">
|
||||
<li>
|
||||
<a href="../index.html">uWebSockets.js v19.3.0 documentation</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="WebSocketBehavior.html">WebSocketBehavior</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h1>Interface WebSocketBehavior</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container container-main">
|
||||
<div class="row">
|
||||
<div class="col-8 col-content">
|
||||
<section class="tsd-panel tsd-comment">
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>A structure holding settings and handlers for a WebSocket URL route handler.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-hierarchy">
|
||||
<h3>Hierarchy</h3>
|
||||
<ul class="tsd-hierarchy">
|
||||
<li>
|
||||
<span class="target">WebSocketBehavior</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel-group tsd-index-group">
|
||||
<h2>Index</h2>
|
||||
<section class="tsd-panel tsd-index-panel">
|
||||
<div class="tsd-index-content">
|
||||
<section class="tsd-index-section ">
|
||||
<h3>Properties</h3>
|
||||
<ul class="tsd-index-list">
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#compression" class="tsd-kind-icon">compression</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#idleTimeout" class="tsd-kind-icon">idle<wbr>Timeout</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#maxBackpressure" class="tsd-kind-icon">max<wbr>Backpressure</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#maxPayloadLength" class="tsd-kind-icon">max<wbr>Payload<wbr>Length</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-index-section ">
|
||||
<h3>Methods</h3>
|
||||
<ul class="tsd-index-list">
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#close" class="tsd-kind-icon">close</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#drain" class="tsd-kind-icon">drain</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#message" class="tsd-kind-icon">message</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#open" class="tsd-kind-icon">open</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#ping" class="tsd-kind-icon">ping</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#pong" class="tsd-kind-icon">pong</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#upgrade" class="tsd-kind-icon">upgrade</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section class="tsd-panel-group tsd-member-group ">
|
||||
<h2>Properties</h2>
|
||||
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
||||
<a name="compression" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> compression</h3>
|
||||
<div class="tsd-signature tsd-kind-icon">compression<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L237">index.d.ts:237</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>What permessage-deflate compression to use. uWS.DISABLED, uWS.SHARED_COMPRESSOR or any of the uWS.DEDICATED_COMPRESSOR_xxxKB. Defaults to uWS.DISABLED.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
||||
<a name="idleTimeout" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> idle<wbr>Timeout</h3>
|
||||
<div class="tsd-signature tsd-kind-icon">idle<wbr>Timeout<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L235">index.d.ts:235</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Maximum amount of seconds that may pass without sending or getting a message. Connection is closed if this timeout passes. Resolution (granularity) for timeouts are typically 4 seconds, rounded to closest.
|
||||
Disable by using 0. Defaults to 120.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
||||
<a name="maxBackpressure" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> max<wbr>Backpressure</h3>
|
||||
<div class="tsd-signature tsd-kind-icon">max<wbr>Backpressure<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L239">index.d.ts:239</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Maximum length of allowed backpressure per socket when publishing or sending messages. Slow receivers with too high backpressure will be skipped until they catch up or timeout. Defaults to 1024 * 1024.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
||||
<a name="maxPayloadLength" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> max<wbr>Payload<wbr>Length</h3>
|
||||
<div class="tsd-signature tsd-kind-icon">max<wbr>Payload<wbr>Length<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L231">index.d.ts:231</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Maximum length of received message. If a client tries to send you a message larger than this, the connection is immediately closed. Defaults to 16 * 1024.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section class="tsd-panel-group tsd-member-group ">
|
||||
<h2>Methods</h2>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="close" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> close</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">close<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a>, code<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L251">index.d.ts:251</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Handler for close event, no matter if error, timeout or graceful close. You may not use WebSocket after this event. Do not send on this WebSocket from within here, it is closed.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>code: <span class="tsd-signature-type">number</span></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>message: <span class="tsd-signature-type">ArrayBuffer</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="drain" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> drain</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">drain<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L249">index.d.ts:249</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Handler for when WebSocket backpressure drains. Check ws.getBufferedAmount(). Use this to guide / drive your backpressure throttling.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="message" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> message</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">message<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span>, isBinary<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L247">index.d.ts:247</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Handler for a WebSocket message. Messages are given as ArrayBuffer no matter if they are binary or not. Given ArrayBuffer is valid during the lifetime of this callback (until first await or return) and will be neutered.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>message: <span class="tsd-signature-type">ArrayBuffer</span></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>isBinary: <span class="tsd-signature-type">boolean</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="open" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> open</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">open<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L245">index.d.ts:245</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Handler for new WebSocket connection. WebSocket is valid from open to close, no errors.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="ping" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> ping</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">ping<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L253">index.d.ts:253</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Handler for received ping control message. You do not need to handle this, pong messages are automatically sent as per the standard.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>message: <span class="tsd-signature-type">ArrayBuffer</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="pong" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> pong</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">pong<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L255">index.d.ts:255</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Handler for received pong control message.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>message: <span class="tsd-signature-type">ArrayBuffer</span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
||||
<a name="upgrade" class="tsd-anchor"></a>
|
||||
<h3><span class="tsd-flag ts-flagOptional">Optional</span> upgrade</h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
||||
<li class="tsd-signature tsd-kind-icon">upgrade<span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a>, req<span class="tsd-signature-symbol">: </span><a href="HttpRequest.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpRequest</a>, context<span class="tsd-signature-symbol">: </span><a href="us_socket_context_t.html" class="tsd-signature-type" data-tsd-kind="Interface">us_socket_context_t</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
||||
</ul>
|
||||
<ul class="tsd-descriptions">
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/e3dio/uWebSockets.js/blob/master/docs/index.d.ts#L243">index.d.ts:243</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Upgrade handler used to intercept HTTP upgrade requests and potentially upgrade to WebSocket.
|
||||
See UpgradeAsync and UpgradeSync example files.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
<ul class="tsd-parameters">
|
||||
<li>
|
||||
<h5>res: <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>req: <a href="HttpRequest.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpRequest</a></h5>
|
||||
</li>
|
||||
<li>
|
||||
<h5>context: <a href="us_socket_context_t.html" class="tsd-signature-type" data-tsd-kind="Interface">us_socket_context_t</a></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
||||
<nav class="tsd-navigation primary">
|
||||
<ul>
|
||||
<li class=" ">
|
||||
<a href="../index.html">Exports</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav class="tsd-navigation secondary menu-sticky">
|
||||
<ul class="before-current">
|
||||
<li class=" tsd-kind-enum">
|
||||
<a href="../enums/ListenOptions.html" class="tsd-kind-icon">Listen<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="AppOptions.html" class="tsd-kind-icon">App<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpRequest.html" class="tsd-kind-icon">Http<wbr>Request</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpResponse.html" class="tsd-kind-icon">Http<wbr>Response</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="MultipartField.html" class="tsd-kind-icon">Multipart<wbr>Field</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="TemplatedApp.html" class="tsd-kind-icon">Templated<wbr>App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="current">
|
||||
<li class="current tsd-kind-interface">
|
||||
<a href="WebSocketBehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
|
||||
<ul>
|
||||
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
||||
<a href="WebSocketBehavior.html#compression" class="tsd-kind-icon">compression</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
||||
<a href="WebSocketBehavior.html#idleTimeout" class="tsd-kind-icon">idle<wbr>Timeout</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
||||
<a href="WebSocketBehavior.html#maxBackpressure" class="tsd-kind-icon">max<wbr>Backpressure</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
||||
<a href="WebSocketBehavior.html#maxPayloadLength" class="tsd-kind-icon">max<wbr>Payload<wbr>Length</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocketBehavior.html#close" class="tsd-kind-icon">close</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocketBehavior.html#drain" class="tsd-kind-icon">drain</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocketBehavior.html#message" class="tsd-kind-icon">message</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocketBehavior.html#open" class="tsd-kind-icon">open</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocketBehavior.html#ping" class="tsd-kind-icon">ping</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocketBehavior.html#pong" class="tsd-kind-icon">pong</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
||||
<a href="WebSocketBehavior.html#upgrade" class="tsd-kind-icon">upgrade</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="after-current">
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket.html" class="tsd-kind-icon">us_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket_context_t.html" class="tsd-kind-icon">us_<wbr>socket_<wbr>context_<wbr>t</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#CompressOptions" class="tsd-kind-icon">Compress<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#RecognizedString" class="tsd-kind-icon">Recognized<wbr>String</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_128KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>128KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_16KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>16KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_256KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>256KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_32KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>32KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_3KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>3KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_4KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>4KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_64KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>64KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_8KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>8KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DISABLED" class="tsd-kind-icon">DISABLED</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#SHARED_COMPRESSOR" class="tsd-kind-icon">SHARED_<wbr>COMPRESSOR</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#App" class="tsd-kind-icon">App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#SSLApp" class="tsd-kind-icon">SSLApp</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#getParts" class="tsd-kind-icon">get<wbr>Parts</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_socket_local_port" class="tsd-kind-icon">us_<wbr>socket_<wbr>local_<wbr>port</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="with-border-bottom">
|
||||
<div class="container">
|
||||
<h2>Legend</h2>
|
||||
<div class="tsd-legend-group">
|
||||
<ul class="tsd-legend">
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="container tsd-generator">
|
||||
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
||||
</div>
|
||||
<div class="overlay"></div>
|
||||
<script src="../assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WebSocketBehavior | uWebSockets.js v20.4.0 documentation</title><meta name="description" content="Documentation for uWebSockets.js v20.4.0 documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">uWebSockets.js v20.4.0 documentation</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../index.html">uWebSockets.js v20.4.0 documentation</a></li><li><a href="WebSocketBehavior.html">WebSocketBehavior</a></li></ul><h1>Interface WebSocketBehavior</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>A structure holding settings and handlers for a WebSocket URL route handler.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">WebSocketBehavior</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#compression" class="tsd-kind-icon">compression</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#idleTimeout" class="tsd-kind-icon">idle<wbr/>Timeout</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#maxBackpressure" class="tsd-kind-icon">max<wbr/>Backpressure</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#maxPayloadLength" class="tsd-kind-icon">max<wbr/>Payload<wbr/>Length</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#sendPingsAutomatically" class="tsd-kind-icon">send<wbr/>Pings<wbr/>Automatically</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#close" class="tsd-kind-icon">close</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#drain" class="tsd-kind-icon">drain</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#message" class="tsd-kind-icon">message</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#open" class="tsd-kind-icon">open</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#ping" class="tsd-kind-icon">ping</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#pong" class="tsd-kind-icon">pong</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#upgrade" class="tsd-kind-icon">upgrade</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="compression" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> compression</h3><div class="tsd-signature tsd-kind-icon">compression<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L224">index.d.ts:224</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>What permessage-deflate compression to use. uWS.DISABLED, uWS.SHARED_COMPRESSOR or any of the uWS.DEDICATED_COMPRESSOR_xxxKB. Defaults to uWS.DISABLED.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="idleTimeout" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> idle<wbr/>Timeout</h3><div class="tsd-signature tsd-kind-icon">idle<wbr/>Timeout<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L222">index.d.ts:222</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Maximum amount of seconds that may pass without sending or getting a message. Connection is closed if this timeout passes. Resolution (granularity) for timeouts are typically 4 seconds, rounded to closest.
|
||||
Disable by using 0. Defaults to 120.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="maxBackpressure" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> max<wbr/>Backpressure</h3><div class="tsd-signature tsd-kind-icon">max<wbr/>Backpressure<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L226">index.d.ts:226</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Maximum length of allowed backpressure per socket when publishing or sending messages. Slow receivers with too high backpressure will be skipped until they catch up or timeout. Defaults to 1024 * 1024.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="maxPayloadLength" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> max<wbr/>Payload<wbr/>Length</h3><div class="tsd-signature tsd-kind-icon">max<wbr/>Payload<wbr/>Length<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L218">index.d.ts:218</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Maximum length of received message. If a client tries to send you a message larger than this, the connection is immediately closed. Defaults to 16 * 1024.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="sendPingsAutomatically" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> send<wbr/>Pings<wbr/>Automatically</h3><div class="tsd-signature tsd-kind-icon">send<wbr/>Pings<wbr/>Automatically<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L228">index.d.ts:228</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Whether or not we should automatically send pings to uphold a stable connection given whatever idleTimeout.</p>
|
||||
</div></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="close" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> close</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">close<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a>, code<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L240">index.d.ts:240</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Handler for close event, no matter if error, timeout or graceful close. You may not use WebSocket after this event. Do not send on this WebSocket from within here, it is closed.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5></li><li><h5>code: <span class="tsd-signature-type">number</span></h5></li><li><h5>message: <span class="tsd-signature-type">ArrayBuffer</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="drain" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> drain</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">drain<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L238">index.d.ts:238</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Handler for when WebSocket backpressure drains. Check ws.getBufferedAmount(). Use this to guide / drive your backpressure throttling.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="message" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> message</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">message<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span>, isBinary<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L236">index.d.ts:236</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Handler for a WebSocket message. Messages are given as ArrayBuffer no matter if they are binary or not. Given ArrayBuffer is valid during the lifetime of this callback (until first await or return) and will be neutered.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5></li><li><h5>message: <span class="tsd-signature-type">ArrayBuffer</span></h5></li><li><h5>isBinary: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="open" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> open</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">open<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L234">index.d.ts:234</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Handler for new WebSocket connection. WebSocket is valid from open to close, no errors.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="ping" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> ping</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">ping<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L242">index.d.ts:242</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Handler for received ping control message. You do not need to handle this, pong messages are automatically sent as per the standard.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5></li><li><h5>message: <span class="tsd-signature-type">ArrayBuffer</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="pong" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> pong</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">pong<span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L244">index.d.ts:244</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Handler for received pong control message.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>ws: <a href="WebSocket.html" class="tsd-signature-type" data-tsd-kind="Interface">WebSocket</a></h5></li><li><h5>message: <span class="tsd-signature-type">ArrayBuffer</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="upgrade" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> upgrade</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">upgrade<span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a>, req<span class="tsd-signature-symbol">: </span><a href="HttpRequest.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpRequest</a>, context<span class="tsd-signature-symbol">: </span><a href="us_socket_context_t.html" class="tsd-signature-type" data-tsd-kind="Interface">us_socket_context_t</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/master/docs/index.d.ts#L232">index.d.ts:232</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Upgrade handler used to intercept HTTP upgrade requests and potentially upgrade to WebSocket.
|
||||
See UpgradeAsync and UpgradeSync example files.</p>
|
||||
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>res: <a href="HttpResponse.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpResponse</a></h5></li><li><h5>req: <a href="HttpRequest.html" class="tsd-signature-type" data-tsd-kind="Interface">HttpRequest</a></h5></li><li><h5>context: <a href="us_socket_context_t.html" class="tsd-signature-type" data-tsd-kind="Interface">us_socket_context_t</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="WebSocketBehavior.html" class="tsd-kind-icon">Web<wbr/>Socket<wbr/>Behavior</a><ul><li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#compression" class="tsd-kind-icon">compression</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#idleTimeout" class="tsd-kind-icon">idle<wbr/>Timeout</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#maxBackpressure" class="tsd-kind-icon">max<wbr/>Backpressure</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#maxPayloadLength" class="tsd-kind-icon">max<wbr/>Payload<wbr/>Length</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="WebSocketBehavior.html#sendPingsAutomatically" class="tsd-kind-icon">send<wbr/>Pings<wbr/>Automatically</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#close" class="tsd-kind-icon">close</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#drain" class="tsd-kind-icon">drain</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#message" class="tsd-kind-icon">message</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#open" class="tsd-kind-icon">open</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#ping" class="tsd-kind-icon">ping</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#pong" class="tsd-kind-icon">pong</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WebSocketBehavior.html#upgrade" class="tsd-kind-icon">upgrade</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
@ -1,203 +1,4 @@
|
||||
<!doctype html>
|
||||
<html class="default no-js">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>us_listen_socket | uWebSockets.js v19.3.0 documentation</title>
|
||||
<meta name="description" content="Documentation for uWebSockets.js v19.3.0 documentation">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../assets/css/main.css">
|
||||
<script async src="../assets/js/search.js" id="search-script"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="tsd-page-toolbar">
|
||||
<div class="container">
|
||||
<div class="table-wrap">
|
||||
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
||||
<div class="field">
|
||||
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
||||
<input id="tsd-search-field" type="text" />
|
||||
</div>
|
||||
<ul class="results">
|
||||
<li class="state loading">Preparing search index...</li>
|
||||
<li class="state failure">The search index is not available</li>
|
||||
</ul>
|
||||
<a href="../index.html" class="title">uWebSockets.js v19.3.0 documentation</a>
|
||||
</div>
|
||||
<div class="table-cell" id="tsd-widgets">
|
||||
<div id="tsd-filter">
|
||||
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
||||
<div class="tsd-filter-group">
|
||||
<div class="tsd-select" id="tsd-filter-visibility">
|
||||
<span class="tsd-select-label">All</span>
|
||||
<ul class="tsd-select-list">
|
||||
<li data-value="public">Public</li>
|
||||
<li data-value="protected">Public/Protected</li>
|
||||
<li data-value="private" class="selected">All</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="checkbox" id="tsd-filter-inherited" checked />
|
||||
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tsd-page-title">
|
||||
<div class="container">
|
||||
<ul class="tsd-breadcrumb">
|
||||
<li>
|
||||
<a href="../index.html">uWebSockets.js v19.3.0 documentation</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="us_listen_socket.html">us_listen_socket</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h1>Interface us_listen_socket</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container container-main">
|
||||
<div class="row">
|
||||
<div class="col-8 col-content">
|
||||
<section class="tsd-panel tsd-comment">
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Native type representing a raw uSockets struct us_listen_socket_t.
|
||||
Careful with this one, it is entirely unchecked and native so invalid usage will blow up.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-hierarchy">
|
||||
<h3>Hierarchy</h3>
|
||||
<ul class="tsd-hierarchy">
|
||||
<li>
|
||||
<span class="target">us_listen_socket</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
||||
<nav class="tsd-navigation primary">
|
||||
<ul>
|
||||
<li class=" ">
|
||||
<a href="../index.html">Exports</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav class="tsd-navigation secondary menu-sticky">
|
||||
<ul class="before-current">
|
||||
<li class=" tsd-kind-enum">
|
||||
<a href="../enums/ListenOptions.html" class="tsd-kind-icon">Listen<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="AppOptions.html" class="tsd-kind-icon">App<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpRequest.html" class="tsd-kind-icon">Http<wbr>Request</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpResponse.html" class="tsd-kind-icon">Http<wbr>Response</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="MultipartField.html" class="tsd-kind-icon">Multipart<wbr>Field</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="TemplatedApp.html" class="tsd-kind-icon">Templated<wbr>App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocketBehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="current">
|
||||
<li class="current tsd-kind-interface">
|
||||
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="after-current">
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket.html" class="tsd-kind-icon">us_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket_context_t.html" class="tsd-kind-icon">us_<wbr>socket_<wbr>context_<wbr>t</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#CompressOptions" class="tsd-kind-icon">Compress<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#RecognizedString" class="tsd-kind-icon">Recognized<wbr>String</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_128KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>128KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_16KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>16KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_256KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>256KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_32KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>32KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_3KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>3KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_4KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>4KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_64KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>64KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_8KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>8KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DISABLED" class="tsd-kind-icon">DISABLED</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#SHARED_COMPRESSOR" class="tsd-kind-icon">SHARED_<wbr>COMPRESSOR</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#App" class="tsd-kind-icon">App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#SSLApp" class="tsd-kind-icon">SSLApp</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#getParts" class="tsd-kind-icon">get<wbr>Parts</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_socket_local_port" class="tsd-kind-icon">us_<wbr>socket_<wbr>local_<wbr>port</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="with-border-bottom">
|
||||
<div class="container">
|
||||
<h2>Legend</h2>
|
||||
<div class="tsd-legend-group">
|
||||
<ul class="tsd-legend">
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="container tsd-generator">
|
||||
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
||||
</div>
|
||||
<div class="overlay"></div>
|
||||
<script src="../assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>us_listen_socket | uWebSockets.js v20.4.0 documentation</title><meta name="description" content="Documentation for uWebSockets.js v20.4.0 documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">uWebSockets.js v20.4.0 documentation</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../index.html">uWebSockets.js v20.4.0 documentation</a></li><li><a href="us_listen_socket.html">us_listen_socket</a></li></ul><h1>Interface us_listen_socket</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Native type representing a raw uSockets struct us_listen_socket_t.
|
||||
Careful with this one, it is entirely unchecked and native so invalid usage will blow up.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">us_listen_socket</span></li></ul></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr/>listen_<wbr/>socket</a><ul></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
@ -1,203 +1,4 @@
|
||||
<!doctype html>
|
||||
<html class="default no-js">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>us_socket | uWebSockets.js v19.3.0 documentation</title>
|
||||
<meta name="description" content="Documentation for uWebSockets.js v19.3.0 documentation">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../assets/css/main.css">
|
||||
<script async src="../assets/js/search.js" id="search-script"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="tsd-page-toolbar">
|
||||
<div class="container">
|
||||
<div class="table-wrap">
|
||||
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
||||
<div class="field">
|
||||
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
||||
<input id="tsd-search-field" type="text" />
|
||||
</div>
|
||||
<ul class="results">
|
||||
<li class="state loading">Preparing search index...</li>
|
||||
<li class="state failure">The search index is not available</li>
|
||||
</ul>
|
||||
<a href="../index.html" class="title">uWebSockets.js v19.3.0 documentation</a>
|
||||
</div>
|
||||
<div class="table-cell" id="tsd-widgets">
|
||||
<div id="tsd-filter">
|
||||
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
||||
<div class="tsd-filter-group">
|
||||
<div class="tsd-select" id="tsd-filter-visibility">
|
||||
<span class="tsd-select-label">All</span>
|
||||
<ul class="tsd-select-list">
|
||||
<li data-value="public">Public</li>
|
||||
<li data-value="protected">Public/Protected</li>
|
||||
<li data-value="private" class="selected">All</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="checkbox" id="tsd-filter-inherited" checked />
|
||||
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tsd-page-title">
|
||||
<div class="container">
|
||||
<ul class="tsd-breadcrumb">
|
||||
<li>
|
||||
<a href="../index.html">uWebSockets.js v19.3.0 documentation</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="us_socket.html">us_socket</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h1>Interface us_socket</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container container-main">
|
||||
<div class="row">
|
||||
<div class="col-8 col-content">
|
||||
<section class="tsd-panel tsd-comment">
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Native type representing a raw uSockets struct us_socket_t.
|
||||
Careful with this one, it is entirely unchecked and native so invalid usage will blow up.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-hierarchy">
|
||||
<h3>Hierarchy</h3>
|
||||
<ul class="tsd-hierarchy">
|
||||
<li>
|
||||
<span class="target">us_socket</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
||||
<nav class="tsd-navigation primary">
|
||||
<ul>
|
||||
<li class=" ">
|
||||
<a href="../index.html">Exports</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav class="tsd-navigation secondary menu-sticky">
|
||||
<ul class="before-current">
|
||||
<li class=" tsd-kind-enum">
|
||||
<a href="../enums/ListenOptions.html" class="tsd-kind-icon">Listen<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="AppOptions.html" class="tsd-kind-icon">App<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpRequest.html" class="tsd-kind-icon">Http<wbr>Request</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpResponse.html" class="tsd-kind-icon">Http<wbr>Response</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="MultipartField.html" class="tsd-kind-icon">Multipart<wbr>Field</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="TemplatedApp.html" class="tsd-kind-icon">Templated<wbr>App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocketBehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="current">
|
||||
<li class="current tsd-kind-interface">
|
||||
<a href="us_socket.html" class="tsd-kind-icon">us_<wbr>socket</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="after-current">
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket_context_t.html" class="tsd-kind-icon">us_<wbr>socket_<wbr>context_<wbr>t</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#CompressOptions" class="tsd-kind-icon">Compress<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#RecognizedString" class="tsd-kind-icon">Recognized<wbr>String</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_128KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>128KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_16KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>16KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_256KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>256KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_32KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>32KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_3KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>3KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_4KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>4KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_64KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>64KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_8KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>8KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DISABLED" class="tsd-kind-icon">DISABLED</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#SHARED_COMPRESSOR" class="tsd-kind-icon">SHARED_<wbr>COMPRESSOR</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#App" class="tsd-kind-icon">App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#SSLApp" class="tsd-kind-icon">SSLApp</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#getParts" class="tsd-kind-icon">get<wbr>Parts</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_socket_local_port" class="tsd-kind-icon">us_<wbr>socket_<wbr>local_<wbr>port</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="with-border-bottom">
|
||||
<div class="container">
|
||||
<h2>Legend</h2>
|
||||
<div class="tsd-legend-group">
|
||||
<ul class="tsd-legend">
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="container tsd-generator">
|
||||
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
||||
</div>
|
||||
<div class="overlay"></div>
|
||||
<script src="../assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>us_socket | uWebSockets.js v20.4.0 documentation</title><meta name="description" content="Documentation for uWebSockets.js v20.4.0 documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">uWebSockets.js v20.4.0 documentation</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../index.html">uWebSockets.js v20.4.0 documentation</a></li><li><a href="us_socket.html">us_socket</a></li></ul><h1>Interface us_socket</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Native type representing a raw uSockets struct us_socket_t.
|
||||
Careful with this one, it is entirely unchecked and native so invalid usage will blow up.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">us_socket</span></li></ul></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="us_socket.html" class="tsd-kind-icon">us_<wbr/>socket</a><ul></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
@ -1,203 +1,4 @@
|
||||
<!doctype html>
|
||||
<html class="default no-js">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>us_socket_context_t | uWebSockets.js v19.3.0 documentation</title>
|
||||
<meta name="description" content="Documentation for uWebSockets.js v19.3.0 documentation">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../assets/css/main.css">
|
||||
<script async src="../assets/js/search.js" id="search-script"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="tsd-page-toolbar">
|
||||
<div class="container">
|
||||
<div class="table-wrap">
|
||||
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
||||
<div class="field">
|
||||
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
||||
<input id="tsd-search-field" type="text" />
|
||||
</div>
|
||||
<ul class="results">
|
||||
<li class="state loading">Preparing search index...</li>
|
||||
<li class="state failure">The search index is not available</li>
|
||||
</ul>
|
||||
<a href="../index.html" class="title">uWebSockets.js v19.3.0 documentation</a>
|
||||
</div>
|
||||
<div class="table-cell" id="tsd-widgets">
|
||||
<div id="tsd-filter">
|
||||
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
||||
<div class="tsd-filter-group">
|
||||
<div class="tsd-select" id="tsd-filter-visibility">
|
||||
<span class="tsd-select-label">All</span>
|
||||
<ul class="tsd-select-list">
|
||||
<li data-value="public">Public</li>
|
||||
<li data-value="protected">Public/Protected</li>
|
||||
<li data-value="private" class="selected">All</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="checkbox" id="tsd-filter-inherited" checked />
|
||||
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tsd-page-title">
|
||||
<div class="container">
|
||||
<ul class="tsd-breadcrumb">
|
||||
<li>
|
||||
<a href="../index.html">uWebSockets.js v19.3.0 documentation</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="us_socket_context_t.html">us_socket_context_t</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h1>Interface us_socket_context_t</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container container-main">
|
||||
<div class="row">
|
||||
<div class="col-8 col-content">
|
||||
<section class="tsd-panel tsd-comment">
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Native type representing a raw uSockets struct us_socket_context_t.
|
||||
Used while upgrading a WebSocket manually.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-hierarchy">
|
||||
<h3>Hierarchy</h3>
|
||||
<ul class="tsd-hierarchy">
|
||||
<li>
|
||||
<span class="target">us_socket_context_t</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
||||
<nav class="tsd-navigation primary">
|
||||
<ul>
|
||||
<li class=" ">
|
||||
<a href="../index.html">Exports</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav class="tsd-navigation secondary menu-sticky">
|
||||
<ul class="before-current">
|
||||
<li class=" tsd-kind-enum">
|
||||
<a href="../enums/ListenOptions.html" class="tsd-kind-icon">Listen<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="AppOptions.html" class="tsd-kind-icon">App<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpRequest.html" class="tsd-kind-icon">Http<wbr>Request</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="HttpResponse.html" class="tsd-kind-icon">Http<wbr>Response</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="MultipartField.html" class="tsd-kind-icon">Multipart<wbr>Field</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="TemplatedApp.html" class="tsd-kind-icon">Templated<wbr>App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="WebSocketBehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-interface">
|
||||
<a href="us_socket.html" class="tsd-kind-icon">us_<wbr>socket</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="current">
|
||||
<li class="current tsd-kind-interface">
|
||||
<a href="us_socket_context_t.html" class="tsd-kind-icon">us_<wbr>socket_<wbr>context_<wbr>t</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="after-current">
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#CompressOptions" class="tsd-kind-icon">Compress<wbr>Options</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-type-alias">
|
||||
<a href="../index.html#RecognizedString" class="tsd-kind-icon">Recognized<wbr>String</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_128KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>128KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_16KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>16KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_256KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>256KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_32KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>32KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_3KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>3KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_4KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>4KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_64KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>64KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DEDICATED_COMPRESSOR_8KB" class="tsd-kind-icon">DEDICATED_<wbr>COMPRESSOR_<wbr>8KB</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#DISABLED" class="tsd-kind-icon">DISABLED</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-variable">
|
||||
<a href="../index.html#SHARED_COMPRESSOR" class="tsd-kind-icon">SHARED_<wbr>COMPRESSOR</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#App" class="tsd-kind-icon">App</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#SSLApp" class="tsd-kind-icon">SSLApp</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#getParts" class="tsd-kind-icon">get<wbr>Parts</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-function">
|
||||
<a href="../index.html#us_socket_local_port" class="tsd-kind-icon">us_<wbr>socket_<wbr>local_<wbr>port</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="with-border-bottom">
|
||||
<div class="container">
|
||||
<h2>Legend</h2>
|
||||
<div class="tsd-legend-group">
|
||||
<ul class="tsd-legend">
|
||||
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="container tsd-generator">
|
||||
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
||||
</div>
|
||||
<div class="overlay"></div>
|
||||
<script src="../assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>us_socket_context_t | uWebSockets.js v20.4.0 documentation</title><meta name="description" content="Documentation for uWebSockets.js v20.4.0 documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">uWebSockets.js v20.4.0 documentation</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../index.html">uWebSockets.js v20.4.0 documentation</a></li><li><a href="us_socket_context_t.html">us_socket_context_t</a></li></ul><h1>Interface us_socket_context_t</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||
<p>Native type representing a raw uSockets struct us_socket_context_t.
|
||||
Used while upgrading a WebSocket manually.</p>
|
||||
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">us_socket_context_t</span></li></ul></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="us_socket_context_t.html" class="tsd-kind-icon">us_<wbr/>socket_<wbr/>context_<wbr/>t</a><ul></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
47
docs/index.d.ts
vendored
@ -73,13 +73,7 @@ export interface WebSocket {
|
||||
/** Sends a ping control message. Returns true on success in similar ways as WebSocket.send does (regarding backpressure). This helper function correlates to WebSocket::send(message, uWS::OpCode::PING, ...) in C++. */
|
||||
ping(message?: RecognizedString) : boolean;
|
||||
|
||||
/** Subscribe to a topic in MQTT syntax.
|
||||
*
|
||||
* MQTT syntax includes things like "root/child/+/grandchild" where "+" is a
|
||||
* wildcard and "root/#" where "#" is a terminating wildcard.
|
||||
*
|
||||
* Read more about MQTT.
|
||||
*/
|
||||
/** Subscribe to a topic. */
|
||||
subscribe(topic: RecognizedString) : boolean;
|
||||
|
||||
/** Unsubscribe from a topic. Returns true on success, if the WebSocket was subscribed. */
|
||||
@ -91,15 +85,8 @@ export interface WebSocket {
|
||||
/** Returns a list of topics this websocket is subscribed to. */
|
||||
getTopics() : string[];
|
||||
|
||||
/** Publish a message to a topic in MQTT syntax. You cannot publish using wildcards, only fully specified topics. Just like with MQTT.
|
||||
*
|
||||
* "parent/child" kind of tree is allowed, but not "parent/#" kind of wildcard publishing.
|
||||
*
|
||||
* The pub/sub system does not guarantee order between what you manually send using WebSocket.send
|
||||
* and what you publish using WebSocket.publish. WebSocket messages are perfectly atomic, but the order in which they appear can get scrambled if you mix the two sending functions on the same socket.
|
||||
* This shouldn't matter in most applications. Order is guaranteed relative to other calls to WebSocket.publish.
|
||||
*
|
||||
* Also keep in mind that backpressure will be automatically managed with pub/sub, meaning some outgoing messages may be dropped if backpressure is greater than specified maxBackpressure.
|
||||
/** Publish a message under topic. Backpressure is managed according to maxBackpressure, closeOnBackpressureLimit settings.
|
||||
* Order is guaranteed since v20.
|
||||
*/
|
||||
publish(topic: RecognizedString, message: RecognizedString, isBinary?: boolean, compress?: boolean) : boolean;
|
||||
|
||||
@ -143,8 +130,8 @@ export interface HttpResponse {
|
||||
* See writeStatus and corking.
|
||||
*/
|
||||
writeHeader(key: RecognizedString, value: RecognizedString) : HttpResponse;
|
||||
/** Enters or continues chunked encoding mode. Writes part of the response. End with zero length write. */
|
||||
write(chunk: RecognizedString) : HttpResponse;
|
||||
/** Enters or continues chunked encoding mode. Writes part of the response. End with zero length write. Returns true if no backpressure was added. */
|
||||
write(chunk: RecognizedString) : boolean;
|
||||
/** Ends this response by copying the contents of body. */
|
||||
end(body?: RecognizedString, closeConnection?: boolean) : HttpResponse;
|
||||
/** Ends this response, or tries to, by streaming appropriately sized chunks of body. Use in conjunction with onWritable. Returns tuple [ok, hasResponded].*/
|
||||
@ -237,6 +224,8 @@ export interface WebSocketBehavior {
|
||||
compression?: CompressOptions;
|
||||
/** Maximum length of allowed backpressure per socket when publishing or sending messages. Slow receivers with too high backpressure will be skipped until they catch up or timeout. Defaults to 1024 * 1024. */
|
||||
maxBackpressure?: number;
|
||||
/** Whether or not we should automatically send pings to uphold a stable connection given whatever idleTimeout. */
|
||||
sendPingsAutomatically?: number;
|
||||
/** Upgrade handler used to intercept HTTP upgrade requests and potentially upgrade to WebSocket.
|
||||
* See UpgradeAsync and UpgradeSync example files.
|
||||
*/
|
||||
@ -338,12 +327,14 @@ export interface MultipartField {
|
||||
/** Takes a POSTed body and contentType, and returns an array of parts if the request is a multipart request */
|
||||
export function getParts(body: RecognizedString, contentType: RecognizedString): MultipartField[] | undefined;
|
||||
|
||||
/** WebSocket compression options */
|
||||
/** WebSocket compression options. Combine any compressor with any decompressor using bitwise OR. */
|
||||
export type CompressOptions = number;
|
||||
/** No compression (always a good idea if you operate using an efficient binary protocol) */
|
||||
export var DISABLED: CompressOptions;
|
||||
/** Zero memory overhead compression (recommended for pub/sub where same message is sent to many receivers) */
|
||||
/** Zero memory overhead compression. */
|
||||
export var SHARED_COMPRESSOR: CompressOptions;
|
||||
/** Zero memory overhead decompression. */
|
||||
export var SHARED_DECOMPRESSOR: CompressOptions;
|
||||
/** Sliding dedicated compress window, requires 3KB of memory per socket */
|
||||
export var DEDICATED_COMPRESSOR_3KB: CompressOptions;
|
||||
/** Sliding dedicated compress window, requires 4KB of memory per socket */
|
||||
@ -360,3 +351,19 @@ export var DEDICATED_COMPRESSOR_64KB: CompressOptions;
|
||||
export var DEDICATED_COMPRESSOR_128KB: CompressOptions;
|
||||
/** Sliding dedicated compress window, requires 256KB of memory per socket */
|
||||
export var DEDICATED_COMPRESSOR_256KB: CompressOptions;
|
||||
/** Sliding dedicated decompress window, requires 32KB of memory per socket (plus about 23KB) */
|
||||
export var DEDICATED_DECOMPRESSOR_32KB: CompressOptions;
|
||||
/** Sliding dedicated decompress window, requires 16KB of memory per socket (plus about 23KB) */
|
||||
export var DEDICATED_DECOMPRESSOR_16KB: CompressOptions;
|
||||
/** Sliding dedicated decompress window, requires 8KB of memory per socket (plus about 23KB) */
|
||||
export var DEDICATED_DECOMPRESSOR_8KB: CompressOptions;
|
||||
/** Sliding dedicated decompress window, requires 4KB of memory per socket (plus about 23KB) */
|
||||
export var DEDICATED_DECOMPRESSOR_4KB: CompressOptions;
|
||||
/** Sliding dedicated decompress window, requires 2KB of memory per socket (plus about 23KB) */
|
||||
export var DEDICATED_DECOMPRESSOR_2KB: CompressOptions;
|
||||
/** Sliding dedicated decompress window, requires 1KB of memory per socket (plus about 23KB) */
|
||||
export var DEDICATED_DECOMPRESSOR_1KB: CompressOptions;
|
||||
/** Sliding dedicated decompress window, requires 512B of memory per socket (plus about 23KB) */
|
||||
export var DEDICATED_DECOMPRESSOR_512B: CompressOptions;
|
||||
/** Sliding dedicated decompress window, requires 32KB of memory per socket (plus about 23KB) */
|
||||
export var DEDICATED_DECOMPRESSOR: CompressOptions;
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"files": [ "index.d.ts" ],
|
||||
"typedocOptions": {
|
||||
"name":"uWebSockets.js v19.3.0 documentation",
|
||||
"name":"uWebSockets.js v20.4.0 documentation",
|
||||
"entryPoints": [ "index.d.ts" ],
|
||||
"out":"generated",
|
||||
"excludeExternals":true,
|
||||
|