Skip to content

Instantly share code, notes, and snippets.

View modeswitch's full-sized avatar

Alan K modeswitch

  • Brainsights
  • Toronto
View GitHub Profile
#!/usr/bin/node
/* creates a data channel between two peer connections and sends binary messages
* after ~4000 messages it will segfault
* reproducible with nodejs-0.10.31 & wrtc-0.0.29
*/
var servers = null, options = {optional: [{DtlsSrtpKeyAgreement:true}]};
var rx, tx, tx_channel;
/* receiving peer */
@modeswitch
modeswitch / app.js
Created June 19, 2017 20:50
basic auth
const express = require("express");
let app = express();
let basicAuth = require("express-basic-auth");
app.use(basicAuth({
users: {
"brainsights": "donthackus",
},
challenge: true,