Merge remote branch 'majek/issue7'
This commit is contained in:
@@ -5,7 +5,7 @@ var Handshake = function(uri, stream) {
|
||||
this._stream = stream;
|
||||
|
||||
var buffer = new Buffer(16), i = 16;
|
||||
while (i--) buffer[i] = Math.floor(Math.random() * 254);
|
||||
while (i--) buffer[i] = Math.floor(Math.random() * 256);
|
||||
this._key = buffer.toString('base64');
|
||||
|
||||
var SHA1 = crypto.createHash('sha1');
|
||||
@@ -256,7 +256,7 @@ var instance = {
|
||||
frame[0] = this.FIN | opcode;
|
||||
|
||||
if (this._masking) {
|
||||
mask = [1,2,3,4].map(function() { return Math.floor(Math.random() * 255) });
|
||||
mask = [1,2,3,4].map(function() { return Math.floor(Math.random() * 256) });
|
||||
for (i = 0, n = data.length; i < n; i++)
|
||||
data[i] = data[i] ^ mask[i % 4];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user