// in page.html
navigator.serviceWorker.controller.postMessage({'hello':'world'});
// in sw.js
self.addEventListener('message', event => {
// Example below is with mitm6 (https://github.com/fox-it/mitm6/) | |
// Note: Adding the '--add-binary' option here is specific to mitm6, not required in all cases. | |
# pip install pyinstaller | |
# pyinstaller --clean -F --add-binary="/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0:." ./mitm6.py | |
// The step above will create a single binary in the ./dist/ directory called mitm6 | |
// Install staticx and dependencies |
<?php | |
declare(strict_types=1); | |
use Directus\Services\AuthService as DirectusAuthService; | |
use Directus\Authentication\Exception\UserNotFoundException; | |
class AuthService | |
{ | |
private function getToken($req) |
// Dletta has implemented a depth-first (and sort of breadth-first) search algorithm for gun graphs. | |
var stack; | |
var nodes; | |
var edges; | |
var start; | |
var u; | |
var label; | |
var opt = true; |
// WARNING: There's much more to know/do around hooks, and | |
// this is just a simplification of how these work. | |
// shared references, updated | |
// per each hook invoke | |
let execution = null; | |
let current = null; | |
let context = null; | |
let args = null; |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> | |
<title>capture microphone audio into buffer</title> | |
</head> | |
<body> | |
<audio id="player" controls></audio> | |
<input | |
type="text" | |
id="username" |
The docs on Gun's Panic are written from the point of view of someone testing Gun itself, rather than an app that uses Gun. As such it isn't very helpful in how to get started, and the tests aren't all that applicable. So, I figured I'd share my findings after building Panic tests for my app.
refs:
NB, in my case, I was using Gun in an extension, so my 'app' is quite well separated from the panic server. Most people will be testing Gun in a regular web page, so it might be simpler.
npm install --save-dev panic-server