For excessively paranoid client authentication.
Updated Apr 5 2019:
because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.
some other notes:
"use strict"; | |
const worker = new Worker("worker.js"); | |
self.onfetch = e => { | |
const transform = new TransformStream(); // creates an identity transform | |
e.respondWith(new Response(transform.readable)); | |
// Give the worker the writable end. An identity transform stream will just shuffle | |
// bytes written there into transform.readable. |
; extracted from RFC 3501 and adapted for Instaparse | |
address = "(" addr-name SP addr-adl SP addr-mailbox SP | |
addr-host ")" | |
addr-adl = nstring | |
; Holds route from [RFC-2822] route-addr if | |
; non-NIL | |
addr-host = nstring |
* CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ MAILBOX-REFERRALS NAMESPACE UIDPLUS ID NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE IDLE AUTH=OTP SASL-IR
* CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE IDLE URLAUTH
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Simon Madine <http://thingsinjars.com> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
function connect() { | |
return new Promise(resolve => { | |
var ws = new WebSocket('wss://hypothes.is/ws?access_token=...') | |
function waitSocket() { | |
if (ws.readyState == 1) { | |
clearInterval(interval) | |
resolve(ws) | |
} | |
} | |
var interval = setInterval(waitSocket, 1000) |