This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = require('crypto') | |
, rrange = 4294967296; | |
/** | |
* Return an integer, pseudo-random number in the range [0, 2^32). | |
*/ | |
var nextInt = function() { | |
return crypto.randomBytes(4).readUInt32BE(0); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies. | |
*/ | |
var crypto = require('crypto') | |
, rrange = 4294967296; | |
/** | |
* Return an integer, pseudo-random number in the range [0, 2^32). | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var Ws = require('ws') | |
, ws = new Ws('ws://localhost:3000/primus'); | |
ws.on('open', function() { | |
var buf = new Buffer([ | |
0x88, // state.lastFragment = true && opcode = 8 | |
0x02, // state.masked = false && length = 2 | |
0x03, // this byte and the next => code = 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs') | |
, server | |
, Primus = require('primus') | |
, server = require('http').createServer() | |
, primus = new Primus(server); | |
primus.on('connection', function(spark) { | |
console.log(spark.id + ' connected'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chars = '̴̴̛̮̫̞͚͉̮̙͕̳̲͉̤̗̹̮̦̪̖̱͍͙̖̟͕̹͕̙̦̣̲̠̪̯̳͖̝̩̝̦͇̥̠̟͚̳̤̹̗̻̭͍͖͕͓̻̥̹̮̙͔̗͍͚͓̗̦̹͈͙͕̘̮͖̝̗̲̤̗̮͈̙͈̹̼̣̹̖̱̤̼̺̤̻͙̗̥̠̱͇̱̝̟̺͍̺̼̜̖͈͇͎͙̲̙̗͇̫̘̖̹͖͓͔̺̱̹͓̮͇̯̜̤̗͍̯̰̫̫̖̰͚̪͚̭͚̥̰̤̟͎̝̲̯̭̹̭̙̼̤͖̞̙̹͈͚̥̦͚͉͖̼̬͓͚̳͉͙͎͚̱̮̗͍̩̻̰̣̫͉͈̞̲͉̫̞͔͆̅̓̓̇ͬ͌ͬͫͩͦ̃͌̿̐ͪͩ̌̇͂̆̑͐ͣ҉̶̲͉͔͎̤̼̘͇̮̥̻̜̹̥͚̲̻̖̗̻̫̼̠̳̗̺̤̗̳͈̪̮̗̝͇͈̙͇͕̺̱̼̤̗̰̬̣͌ͬͧ͊́ͧͩ͌͌̐̓̃ͥ̄ͤ͑̈ͬ͆ͬ͂̇̿̅҉̨̙̼̳̭̙͍̻̱̠͈̮̺̣̝̱̙̺͉̳͎̻͔̯̪̝͕͚̣̜̼̞͇̠̘̠̪̫͙͙̬̰̰̫͚̗͕̝̤̗͕̲̮̝̼̺͙͚̟͓̣̥͍͙̘̩̖͇͎̬̠̝͈̺̙̮̬̗̪̤͕͇͕̰̮͖͉̬̙̪̤̝̹͖͖̻̬̹͙̞̗͓̞̭̜̠̟̐͋͊͑̌̾̉͆̆̍̿̾ͤ̔̉̈̂̾̈ͭ' | |
, len = chars.length | |
, str = 'foo and bar' | |
, result = ''; | |
str.split('').forEach(function char(chr) { | |
for (var i = 0; i < 20; i++) { | |
var r = Math.floor(Math.random() * len); | |
chr += chars.charAt(r); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN CERTIFICATE----- | |
MIICATCCAWoCCQDuPBBeAphl0zANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB | |
VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0 | |
cyBQdHkgTHRkMB4XDTE0MDIyNjE5MTg0OVoXDTE0MDMyODE5MTg0OVowRTELMAkG | |
A1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0 | |
IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA68hH | |
8JNVn7mGxtSRl+GI+jw12t5kX7+ML42pHteynBki1FmNnYAgUekQ8EnGCwXyUOaD | |
YxglhAv6Yu0tggE1hcJNbDh4a6N2B02fUcIwEHPGWJNVEB8L92mfDc0tS00a5Drp | |
yv3T965R0HF7GNlF1MU3Y3V6rk0WNWv1sECVCQkCAwEAATANBgkqhkiG9w0BAQUF | |
AAOBgQDOUWndwR84vPQKgyYEjK/wspVQ7Rp7qV6VYezTLGJJYhdOgH6xqoGzcj/5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sock = new SockJS('/test', null, { | |
protocols_whitelist: ['jsonp-polling'] | |
}); | |
sock.onopen = function () { | |
console.log('open'); | |
}; | |
sock.onerror = function (err) { | |
console.log(err); | |
}; | |
sock.onmessage = function (e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- sockjs-0.3.4.js 2014-03-26 09:49:46.000000000 +0100 | |
+++ sockjs-0.3.4-m.js 2014-03-26 09:55:07.000000000 +0100 | |
@@ -933,6 +933,8 @@ | |
* ***** END LICENSE BLOCK ***** | |
*/ | |
+var timestamp; | |
+ | |
var SockJS = function(url, dep_protocols_whitelist, options) { | |
if (this === _window) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var socket = new eio.Socket({ | |
rememberUpgrade: false, | |
transports: ['polling'] | |
}); | |
socket.on('open', function () { | |
console.log('open'); | |
socket.on('message', function (data) { | |
console.log(data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: node server.js |
OlderNewer