qz-tray
Version:
Connects a web client to the QZ Tray software. Enables printing and device communication from javascript.
753 lines (213 loc) • 10.2 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: networking</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: networking</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="qz.html">qz</a>.</span>networking</h2>
</header>
<article>
<div class="container-overview">
<div class="description">Calls related to networking information</div>
<dl class="details">
<dt class="tag-since">Since:</dt>
<dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="qz-tray.js.html">qz-tray.js</a>, <a href="qz-tray.js.html#line2666">line 2666</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".device"><span class="type-signature">(static) </span>device<span class="signature">(hostname<span class="signature-attributes">opt</span>, port<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<(Object|Error)>}</span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>hostname</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Hostname to try to connect to when determining network interfaces, defaults to "google.com"</td>
</tr>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Port to use with custom hostname, defaults to 443</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-since">Since:</dt>
<dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="qz-tray.js.html">qz-tray.js</a>, <a href="qz-tray.js.html#line2680">line 2680</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Connected system's network information.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<(Object|Error)></span>
</dd>
</dl>
<h4 class="name" id=".devices"><span class="type-signature">(static) </span>devices<span class="signature">(hostname<span class="signature-attributes">opt</span>, port<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<(Array.<Object>|Error)>}</span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>hostname</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Hostname to try to connect to when determining network interfaces, defaults to "google.com"</td>
</tr>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Port to use with custom hostname, defaults to 443</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-since">Since:</dt>
<dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="qz-tray.js.html">qz-tray.js</a>, <a href="qz-tray.js.html#line2726">line 2726</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Connected system's network information.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<(Array.<Object>|Error)></span>
</dd>
</dl>
<h4 class="name" id=".hostname"><span class="type-signature">(static) </span>hostname<span class="signature">(hostname<span class="signature-attributes">opt</span>, port<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<(string|Error)>}</span></h4>
<div class="description">
Get computer hostname
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>hostname</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">DEPRECATED Hostname to try to connect to when determining network interfaces, defaults to "google.com"</td>
</tr>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">DEPRECATED Port to use with custom hostname, defaults to 443</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-since">Since:</dt>
<dd class="tag-since"><ul class="dummy"><li>2.2.2</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="qz-tray.js.html">qz-tray.js</a>, <a href="qz-tray.js.html#line2704">line 2704</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Connected system's hostname.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<(string|Error)></span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="qz.html">qz</a></li><li><a href="qz.api.html">api</a></li><li><a href="qz.configs.html">configs</a></li><li><a href="qz.file.html">file</a></li><li><a href="qz.hid.html">hid</a></li><li><a href="qz.networking.html">networking</a></li><li><a href="qz.printers.html">printers</a></li><li><a href="qz.security.html">security</a></li><li><a href="qz.serial.html">serial</a></li><li><a href="qz.socket.html">socket</a></li><li><a href="qz.usb.html">usb</a></li><li><a href="qz.websocket.html">websocket</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.7</a> on Thu Apr 02 2026 13:01:02 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>