Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (31 sloc) 1.17 KB
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Test OTR</title>
</head>
<body></body>
<script>
var start = (new Date()).getTime();
</script>
<!-- Load dependencies -->
<script src="../build/dep/seedrandom.js"></script>
<script src="../build/dep/bigint.js"></script>
<script src="../build/dep/crypto.js"></script>
<!-- Load otr.js or otr.min.js -->
<script src="../build/otr.js"></script>
<!-- Ready to go! -->
<script>
document.write('loading scripts / seeding random took <strong>' + ((new Date()).getTime() - start) + 'ms</strong>');
var ui = function (msg) { console.log(msg); };
var userA = new OTR(null, ui, function (msg) {
userB.receiveMsg(msg);
});
document.write('<br />generating OTR object took <strong>' + ((new Date()).getTime() - start) + 'ms</strong>');
var userB = new OTR(null, ui, userA.receiveMsg);
start = (new Date()).getTime();
userA.sendQueryMsg()
document.write('<br />ake took <strong>' + ((new Date()).getTime() - start) + 'ms</strong>');
document.write('<br />message state is ' + (userA.msgstate ? 'encrypted' : 'plaintext') + '</strong>');
</script>
</html>
Something went wrong with that request. Please try again.