Files
beef/docs/beef.websocket.html
2024-12-25 11:40:55 +10:00

499 lines
6.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: websocket</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: websocket</h1>
<section>
<header>
<h2>websocket</h2>
</header>
<article>
<div class="container-overview">
<div class="description"><p>Manage the WebSocket communication channel.
This channel is much faster and responsive, and it's used automatically
if the browser supports WebSockets AND beef.http.websocket.enable = true.</p></div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="websocket.js.html">websocket.js</a>, <a href="websocket.js.html#line8">line 8</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".alive"><span class="type-signature">(static) </span>alive<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Polling mechanism, to notify the BeEF server that the browser is still hooked,
and the WebSocket channel still alive.
todo: there is probably a more efficient way to do this. Double-check WebSocket API.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="websocket.js.html">websocket.js</a>, <a href="websocket.js.html#line86">line 86</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".init"><span class="type-signature">(static) </span>init<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Initialize the WebSocket client object.
Note: use WebSocketSecure only if the hooked origin is under https.
Mixed-content in WS is quite different from a non-WS context.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="websocket.js.html">websocket.js</a>, <a href="websocket.js.html#line26">line 26</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".send"><span class="type-signature">(static) </span>send<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Send data back to BeEF. This is basically the same as beef.net.send,
but doesn't queue commands.
Example usage:
beef.websocket.send('{&quot;handler&quot; : &quot;' + handler + '&quot;, &quot;cid&quot; :&quot;' + cid +
'&quot;, &quot;result&quot;:&quot;' + beef.encode.base64.encode(beef.encode.json.stringify(results)) +
'&quot;,&quot;callback&quot;: &quot;' + callback + '&quot;,&quot;bh&quot;:&quot;' + beef.session.get_hook_session_id() + '&quot; }');</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="websocket.js.html">websocket.js</a>, <a href="websocket.js.html#line75">line 75</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".start"><span class="type-signature">(static) </span>start<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Send Hello message to the BeEF server and start async polling.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="websocket.js.html">websocket.js</a>, <a href="websocket.js.html#line48">line 48</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="BeefJS.html">BeefJS</a></li><li><a href="beef.are.html">are</a></li><li><a href="beef.browser.html">browser</a></li><li><a href="beef.browser.cookie.html">cookie</a></li><li><a href="beef.browser.popup.html">popup</a></li><li><a href="beef.dom.html">dom</a></li><li><a href="beef.encode.base64.html">base64</a></li><li><a href="beef.encode.json.html">json</a></li><li><a href="beef.geolocation.html">geolocation</a></li><li><a href="beef.hardware.html">hardware</a></li><li><a href="beef.init.html">init</a></li><li><a href="beef.logger.html">logger</a></li><li><a href="beef.mitb.html">mitb</a></li><li><a href="beef.net.html">net</a></li><li><a href="beef.net.connection.html">connection</a></li><li><a href="beef.net.cors.html">cors</a></li><li><a href="beef.net.dns.html">dns</a></li><li><a href="beef.net.local.html">local</a></li><li><a href="beef.net.portscanner.html">portscanner</a></li><li><a href="beef.net.requester.html">requester</a></li><li><a href="beef.net.xssrays.html">xssrays</a></li><li><a href="beef.os.html">os</a></li><li><a href="beef.session.html">session</a></li><li><a href="beef.timeout.html">timeout</a></li><li><a href="beef.updater.html">updater</a></li><li><a href="beef.webrtc.html">webrtc</a></li><li><a href="beef.websocket.html">websocket</a></li></ul><h3>Global</h3><ul><li><a href="global.html#platform">platform</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Wed Dec 25 2024 11:28:12 GMT+1000 (Australian Eastern Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>