first commit

This commit is contained in:
monjack
2025-06-20 18:01:48 +08:00
commit 6daa6d65c1
24611 changed files with 2512443 additions and 0 deletions

12
app_vue/node_modules/hpack.js/lib/hpack.js generated vendored Normal file
View File

@ -0,0 +1,12 @@
var hpack = exports;
hpack.utils = require('./hpack/utils');
hpack.huffman = require('./hpack/huffman');
hpack['static-table'] = require('./hpack/static-table');
hpack.table = require('./hpack/table');
hpack.decoder = require('./hpack/decoder');
hpack.decompressor = require('./hpack/decompressor');
hpack.encoder = require('./hpack/encoder');
hpack.compressor = require('./hpack/compressor');

127
app_vue/node_modules/hpack.js/lib/hpack/compressor.js generated vendored Normal file
View File

@ -0,0 +1,127 @@
var hpack = require('../hpack');
var utils = hpack.utils;
var encoder = hpack.encoder;
var table = hpack.table;
var assert = utils.assert;
var inherits = require('inherits');
var Duplex = require('readable-stream').Duplex;
function Compressor(options) {
Duplex.call(this, {
writableObjectMode: true
});
this._encoder = null;
this._table = table.create(options.table);
}
inherits(Compressor, Duplex);
module.exports = Compressor;
Compressor.create = function create(options) {
return new Compressor(options);
};
Compressor.prototype._read = function _read() {
// We only push!
};
Compressor.prototype._write = function _write(data, enc, cb) {
assert(Array.isArray(data), 'Compressor.write() expects list of headers');
this._encoder = encoder.create();
for (var i = 0; i < data.length; i++)
this._encodeHeader(data[i]);
var data = this._encoder.render();
this._encoder = null;
cb(null);
for (var i = 0; i < data.length; i++)
this.push(data[i]);
};
Compressor.prototype.updateTableSize = function updateTableSize(size) {
if (size >= this._table.protocolMaxSize) {
size = this._table.protocolMaxSize;
var enc = encoder.create();
// indexed = 0
// incremental = 0
// update = 1
enc.encodeBits(1, 3);
enc.encodeInt(size);
var data = enc.render();
for (var i = 0; i < data.length; i++)
this.push(data[i]);
}
this._table.updateSize(size);
};
Compressor.prototype.reset = function reset() {
var enc = encoder.create();
var size = this._table.maxSize;
// indexed = 0
// incremental = 0
// update = 1
enc.encodeBits(1, 3);
enc.encodeInt(0);
// Evict everything
this._table.updateSize(0);
// indexed = 0
// incremental = 0
// update = 1
enc.encodeBits(1, 3);
enc.encodeInt(size);
// Revert size
this._table.updateSize(size);
var data = enc.render();
for (var i = 0; i < data.length; i++)
this.push(data[i]);
};
Compressor.prototype._encodeHeader = function _encodeHeader(header) {
if (header.neverIndex) {
var index = 0;
var neverIndex = 1;
var isIndexed = 0;
var isIncremental = 0;
} else {
var index = this._table.reverseLookup(header.name, header.value);
var isIndexed = index > 0;
var isIncremental = header.incremental !== false;
var neverIndex = 0;
}
this._encoder.encodeBit(isIndexed);
if (isIndexed) {
this._encoder.encodeInt(index);
return;
}
var name = utils.toArray(header.name);
var value = utils.toArray(header.value);
this._encoder.encodeBit(isIncremental);
if (isIncremental) {
this._table.add(header.name, header.value, name.length, value.length);
} else {
// Update = false
this._encoder.encodeBit(0);
this._encoder.encodeBit(neverIndex);
}
// index is negative for `name`-only headers
this._encoder.encodeInt(-index);
if (index === 0)
this._encoder.encodeStr(name, header.huffman !== false);
this._encoder.encodeStr(value, header.huffman !== false);
};

169
app_vue/node_modules/hpack.js/lib/hpack/decoder.js generated vendored Normal file
View File

@ -0,0 +1,169 @@
var hpack = require('../hpack');
var utils = hpack.utils;
var huffman = hpack.huffman.decode;
var assert = utils.assert;
var OffsetBuffer = require('obuf');
function Decoder() {
this.buffer = new OffsetBuffer();
this.bitOffset = 0;
// Used internally in decodeStr
this._huffmanNode = null;
}
module.exports = Decoder;
Decoder.create = function create() {
return new Decoder();
};
Decoder.prototype.isEmpty = function isEmpty() {
return this.buffer.isEmpty();
};
Decoder.prototype.push = function push(chunk) {
this.buffer.push(chunk);
};
Decoder.prototype.decodeBit = function decodeBit() {
// Need at least one octet
assert(this.buffer.has(1), 'Buffer too small for an int');
var octet;
var offset = this.bitOffset;
if (++this.bitOffset === 8) {
octet = this.buffer.readUInt8();
this.bitOffset = 0;
} else {
octet = this.buffer.peekUInt8();
}
return (octet >>> (7 - offset)) & 1;
};
// Just for testing
Decoder.prototype.skipBits = function skipBits(n) {
this.bitOffset += n;
this.buffer.skip(this.bitOffset >> 3);
this.bitOffset &= 0x7;
};
Decoder.prototype.decodeInt = function decodeInt() {
// Need at least one octet
assert(this.buffer.has(1), 'Buffer too small for an int');
var prefix = 8 - this.bitOffset;
// We are going to end up octet-aligned
this.bitOffset = 0;
var max = (1 << prefix) - 1;
var octet = this.buffer.readUInt8() & max;
// Fast case - int fits into the prefix
if (octet !== max)
return octet;
// TODO(indutny): what about > 32bit numbers?
var res = 0;
var isLast = false;
var len = 0;
do {
octet = this.buffer.readUInt8();
isLast = (octet & 0x80) === 0;
res <<= 7;
res |= octet & 0x7f;
len++;
} while (!isLast);
assert(isLast, 'Incomplete data for multi-octet integer');
assert(len <= 4, 'Integer does not fit into 32 bits');
// Reverse bits
res = (res >>> 21) |
(((res >> 14) & 0x7f) << 7) |
(((res >> 7) & 0x7f) << 14) |
((res & 0x7f) << 21);
res >>= (4 - len) * 7;
// Append prefix max
res += max;
return res;
};
Decoder.prototype.decodeHuffmanWord = function decodeHuffmanWord(input,
inputBits,
out) {
var root = huffman;
var node = this._huffmanNode;
var word = input;
var bits = inputBits;
for (; bits > 0; word &= (1 << bits) - 1) {
// Nudge the word bit length to match it
for (var i = Math.max(0, bits - 8); i < bits; i++) {
var subnode = node[word >>> i];
if (typeof subnode !== 'number') {
node = subnode;
bits = i;
break;
}
if (subnode === 0)
continue;
// Word bit length should match
if ((subnode >>> 9) !== bits - i) {
subnode = 0;
continue;
}
var octet = subnode & 0x1ff;
assert(octet !== 256, 'EOS in encoding');
out.push(octet);
node = root;
bits = i;
break;
}
if (subnode === 0)
break;
}
this._huffmanNode = node;
return bits;
};
Decoder.prototype.decodeStr = function decodeStr() {
var isHuffman = this.decodeBit();
var len = this.decodeInt();
assert(this.buffer.has(len), 'Not enough octets for string');
if (!isHuffman)
return this.buffer.take(len);
this._huffmanNode = huffman;
var out = [];
var word = 0;
var bits = 0;
var lastKey = 0;
for (var i = 0; i < len; i++) {
word <<= 8;
word |= this.buffer.readUInt8();
bits += 8;
bits = this.decodeHuffmanWord(word, bits, out);
lastKey = word >> bits;
word &= (1 << bits) - 1;
}
assert(this._huffmanNode === huffman, '8-bit EOS');
assert(word + 1 === (1 << bits), 'Final sequence is not EOS');
this._huffmanNode = null;
return out;
};

116
app_vue/node_modules/hpack.js/lib/hpack/decompressor.js generated vendored Normal file
View File

@ -0,0 +1,116 @@
var hpack = require('../hpack');
var utils = hpack.utils;
var decoder = hpack.decoder;
var table = hpack.table;
var assert = utils.assert;
var inherits = require('inherits');
var Duplex = require('readable-stream').Duplex;
function Decompressor(options) {
Duplex.call(this, {
readableObjectMode: true
});
this._decoder = decoder.create();
this._table = table.create(options.table);
}
inherits(Decompressor, Duplex);
module.exports = Decompressor;
Decompressor.create = function create(options) {
return new Decompressor(options);
};
Decompressor.prototype._read = function _read() {
// We only push!
};
Decompressor.prototype._write = function _write(data, enc, cb) {
this._decoder.push(data);
cb(null);
};
Decompressor.prototype.execute = function execute(cb) {
while (!this._decoder.isEmpty()) {
try {
this._execute();
} catch (err) {
if (cb)
return done(err);
else
return this.emit('error', err);
}
}
if (cb)
done(null);
function done(err) {
process.nextTick(function() {
cb(err);
});
}
};
Decompressor.prototype.updateTableSize = function updateTableSize(size) {
this._table.updateSize(size);
};
Decompressor.prototype._execute = function _execute() {
var isIndexed = this._decoder.decodeBit();
if (isIndexed)
return this._processIndexed();
var isIncremental = this._decoder.decodeBit();
var neverIndex = 0;
if (!isIncremental) {
var isUpdate = this._decoder.decodeBit();
if (isUpdate)
return this._processUpdate();
neverIndex = this._decoder.decodeBit();
}
this._processLiteral(isIncremental, neverIndex);
};
Decompressor.prototype._processIndexed = function _processIndexed() {
var index = this._decoder.decodeInt();
var lookup = this._table.lookup(index);
this.push({ name: lookup.name, value: lookup.value, neverIndex: false });
};
Decompressor.prototype._processLiteral = function _processLiteral(inc, never) {
var index = this._decoder.decodeInt();
var name;
var nameSize;
// Literal header-name too
if (index === 0) {
name = this._decoder.decodeStr();
nameSize = name.length;
name = utils.stringify(name);
} else {
var lookup = this._table.lookup(index);
nameSize = lookup.nameSize;
name = lookup.name;
}
var value = this._decoder.decodeStr();
var valueSize = value.length;
value = utils.stringify(value);
if (inc)
this._table.add(name, value, nameSize, valueSize);
this.push({ name: name, value: value, neverIndex: never !== 0});
};
Decompressor.prototype._processUpdate = function _processUpdate() {
var size = this._decoder.decodeInt();
this.updateTableSize(size);
};

129
app_vue/node_modules/hpack.js/lib/hpack/encoder.js generated vendored Normal file
View File

@ -0,0 +1,129 @@
var hpack = require('../hpack');
var utils = hpack.utils;
var huffman = hpack.huffman.encode;
var assert = utils.assert;
var WBuf = require('wbuf');
function Encoder() {
this.buffer = new WBuf();
this.word = 0;
this.bitOffset = 0;
}
module.exports = Encoder;
Encoder.create = function create() {
return new Encoder();
};
Encoder.prototype.render = function render() {
return this.buffer.render();
};
Encoder.prototype.encodeBit = function encodeBit(bit) {
var octet;
this.word <<= 1;
this.word |= bit;
this.bitOffset++;
if (this.bitOffset === 8) {
this.buffer.writeUInt8(this.word);
this.word = 0;
this.bitOffset = 0;
}
};
Encoder.prototype.encodeBits = function encodeBits(bits, len) {
var left = bits;
var leftLen = len;
while (leftLen > 0) {
var avail = Math.min(leftLen, 8 - this.bitOffset);
var toWrite = left >>> (leftLen - avail);
if (avail === 8) {
this.buffer.writeUInt8(toWrite);
} else {
this.word <<= avail;
this.word |= toWrite;
this.bitOffset += avail;
if (this.bitOffset === 8) {
this.buffer.writeUInt8(this.word);
this.word = 0;
this.bitOffset = 0;
}
}
leftLen -= avail;
left &= (1 << leftLen) - 1;
}
};
// Just for testing
Encoder.prototype.skipBits = function skipBits(num) {
this.bitOffset += num;
this.buffer.skip(this.bitOffset >> 3);
this.bitOffset &= 0x7;
};
Encoder.prototype.encodeInt = function encodeInt(num) {
var prefix = 8 - this.bitOffset;
// We are going to end up octet-aligned
this.bitOffset = 0;
var max = (1 << prefix) - 1;
// Fast case - int fits into the prefix
if (num < max) {
this.buffer.writeUInt8((this.word << prefix) | num);
return octet;
}
var left = num - max;
this.buffer.writeUInt8((this.word << prefix) | max);
do {
var octet = left & 0x7f;
left >>= 7;
if (left !== 0)
octet |= 0x80;
this.buffer.writeUInt8(octet);
} while (left !== 0);
};
Encoder.prototype.encodeStr = function encodeStr(value, isHuffman) {
this.encodeBit(isHuffman ? 1 : 0);
if (!isHuffman) {
this.buffer.reserve(value.length + 1);
this.encodeInt(value.length);
for (var i = 0; i < value.length; i++)
this.buffer.writeUInt8(value[i]);
return;
}
var codes = [];
var len = 0;
var pad = 0;
for (var i = 0; i < value.length; i++) {
var code = huffman[value[i]];
codes.push(code);
len += code[0];
}
if (len % 8 !== 0)
pad = 8 - (len % 8);
len += pad;
this.buffer.reserve((len / 8) + 1);
this.encodeInt(len / 8);
for (var i = 0; i < codes.length; i++) {
var code = codes[i];
this.encodeBits(code[1], code[0]);
}
// Append padding
this.encodeBits(0xff >>> (8 - pad), pad);
};

159
app_vue/node_modules/hpack.js/lib/hpack/huffman.js generated vendored Normal file
View File

@ -0,0 +1,159 @@
exports.decode =
[2608,2609,2610,2657,2659,2661,2665,2671,2675,2676,0,0,0,0,0,0,0,0,0,0,
3104,3109,3117,3118,3119,3123,3124,3125,3126,3127,3128,3129,3133,3137,3167,
3170,3172,3174,3175,3176,3180,3181,3182,3184,3186,3189,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3642,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,
3664,3665,3666,3667,3668,3669,3670,3671,3673,3690,3691,3697,3702,3703,3704,
3705,3706,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1628,1731,1744,0,0,0,2176,2178,
2179,2210,2232,2242,2272,2274,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2713,2721,2727,
2732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0],[2736,2737,2739,2769,2776,2777,2787,2789,2790,0,0,0,0,0,0,0,0,0,
3201,3204,3205,3206,3208,3218,3226,3228,3232,3235,3236,3241,3242,3245,3250,
3253,3257,3258,3259,3261,3262,3268,3270,3300,3304,3305,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3585,
3719,3721,3722,3723,3724,3725,3727,3731,3733,3734,3735,3736,3739,3741,3742,
3749,3750,3752,3758,3759,3764,3766,3767,3772,3775,3781,3815,3823,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0]]]];
exports.encode =
[[13,8184],[23,8388568],[28,268435426],[28,268435427],[28,268435428],[28,
268435429],[28,268435430],[28,268435431],[28,268435432],[24,16777194],[30,
1073741820],[28,268435433],[28,268435434],[30,1073741821],[28,268435435],
[28,268435436],[28,268435437],[28,268435438],[28,268435439],[28,268435440],
[28,268435441],[28,268435442],[30,1073741822],[28,268435443],[28,
268435444],[28,268435445],[28,268435446],[28,268435447],[28,268435448],[28,
268435449],[28,268435450],[28,268435451],[6,20],[10,1016],[10,1017],[12,
4090],[13,8185],[6,21],[8,248],[11,2042],[10,1018],[10,1019],[8,249],[11,
2043],[8,250],[6,22],[6,23],[6,24],[5,0],[5,1],[5,2],[6,25],[6,26],[6,27],
[6,28],[6,29],[6,30],[6,31],[7,92],[8,251],[15,32764],[6,32],[12,4091],[10,
1020],[13,8186],[6,33],[7,93],[7,94],[7,95],[7,96],[7,97],[7,98],[7,99],[7,
100],[7,101],[7,102],[7,103],[7,104],[7,105],[7,106],[7,107],[7,108],[7,
109],[7,110],[7,111],[7,112],[7,113],[7,114],[8,252],[7,115],[8,253],[13,
8187],[19,524272],[13,8188],[14,16380],[6,34],[15,32765],[5,3],[6,35],[5,
4],[6,36],[5,5],[6,37],[6,38],[6,39],[5,6],[7,116],[7,117],[6,40],[6,41],
[6,42],[5,7],[6,43],[7,118],[6,44],[5,8],[5,9],[6,45],[7,119],[7,120],[7,
121],[7,122],[7,123],[15,32766],[11,2044],[14,16381],[13,8189],[28,
268435452],[20,1048550],[22,4194258],[20,1048551],[20,1048552],[22,
4194259],[22,4194260],[22,4194261],[23,8388569],[22,4194262],[23,8388570],
[23,8388571],[23,8388572],[23,8388573],[23,8388574],[24,16777195],[23,
8388575],[24,16777196],[24,16777197],[22,4194263],[23,8388576],[24,
16777198],[23,8388577],[23,8388578],[23,8388579],[23,8388580],[21,2097116],
[22,4194264],[23,8388581],[22,4194265],[23,8388582],[23,8388583],[24,
16777199],[22,4194266],[21,2097117],[20,1048553],[22,4194267],[22,4194268],
[23,8388584],[23,8388585],[21,2097118],[23,8388586],[22,4194269],[22,
4194270],[24,16777200],[21,2097119],[22,4194271],[23,8388587],[23,8388588],
[21,2097120],[21,2097121],[22,4194272],[21,2097122],[23,8388589],[22,
4194273],[23,8388590],[23,8388591],[20,1048554],[22,4194274],[22,4194275],
[22,4194276],[23,8388592],[22,4194277],[22,4194278],[23,8388593],[26,
67108832],[26,67108833],[20,1048555],[19,524273],[22,4194279],[23,8388594],
[22,4194280],[25,33554412],[26,67108834],[26,67108835],[26,67108836],[27,
134217694],[27,134217695],[26,67108837],[24,16777201],[25,33554413],[19,
524274],[21,2097123],[26,67108838],[27,134217696],[27,134217697],[26,
67108839],[27,134217698],[24,16777202],[21,2097124],[21,2097125],[26,
67108840],[26,67108841],[28,268435453],[27,134217699],[27,134217700],[27,
134217701],[20,1048556],[24,16777203],[20,1048557],[21,2097126],[22,
4194281],[21,2097127],[21,2097128],[23,8388595],[22,4194282],[22,4194283],
[25,33554414],[25,33554415],[24,16777204],[24,16777205],[26,67108842],[23,
8388596],[26,67108843],[27,134217702],[26,67108844],[26,67108845],[27,
134217703],[27,134217704],[27,134217705],[27,134217706],[27,134217707],[28,
268435454],[27,134217708],[27,134217709],[27,134217710],[27,134217711],[27,
134217712],[26,67108846],[30,1073741823]];

691
app_vue/node_modules/hpack.js/lib/hpack/static-table.js generated vendored Normal file
View File

@ -0,0 +1,691 @@
exports.table = [
{
"name": ":authority",
"value": "",
"nameSize": 10,
"totalSize": 42
},
{
"name": ":method",
"value": "GET",
"nameSize": 7,
"totalSize": 42
},
{
"name": ":method",
"value": "POST",
"nameSize": 7,
"totalSize": 43
},
{
"name": ":path",
"value": "/",
"nameSize": 5,
"totalSize": 38
},
{
"name": ":path",
"value": "/index.html",
"nameSize": 5,
"totalSize": 48
},
{
"name": ":scheme",
"value": "http",
"nameSize": 7,
"totalSize": 43
},
{
"name": ":scheme",
"value": "https",
"nameSize": 7,
"totalSize": 44
},
{
"name": ":status",
"value": "200",
"nameSize": 7,
"totalSize": 42
},
{
"name": ":status",
"value": "204",
"nameSize": 7,
"totalSize": 42
},
{
"name": ":status",
"value": "206",
"nameSize": 7,
"totalSize": 42
},
{
"name": ":status",
"value": "304",
"nameSize": 7,
"totalSize": 42
},
{
"name": ":status",
"value": "400",
"nameSize": 7,
"totalSize": 42
},
{
"name": ":status",
"value": "404",
"nameSize": 7,
"totalSize": 42
},
{
"name": ":status",
"value": "500",
"nameSize": 7,
"totalSize": 42
},
{
"name": "accept-charset",
"value": "",
"nameSize": 14,
"totalSize": 46
},
{
"name": "accept-encoding",
"value": "gzip, deflate",
"nameSize": 15,
"totalSize": 60
},
{
"name": "accept-language",
"value": "",
"nameSize": 15,
"totalSize": 47
},
{
"name": "accept-ranges",
"value": "",
"nameSize": 13,
"totalSize": 45
},
{
"name": "accept",
"value": "",
"nameSize": 6,
"totalSize": 38
},
{
"name": "access-control-allow-origin",
"value": "",
"nameSize": 27,
"totalSize": 59
},
{
"name": "age",
"value": "",
"nameSize": 3,
"totalSize": 35
},
{
"name": "allow",
"value": "",
"nameSize": 5,
"totalSize": 37
},
{
"name": "authorization",
"value": "",
"nameSize": 13,
"totalSize": 45
},
{
"name": "cache-control",
"value": "",
"nameSize": 13,
"totalSize": 45
},
{
"name": "content-disposition",
"value": "",
"nameSize": 19,
"totalSize": 51
},
{
"name": "content-encoding",
"value": "",
"nameSize": 16,
"totalSize": 48
},
{
"name": "content-language",
"value": "",
"nameSize": 16,
"totalSize": 48
},
{
"name": "content-length",
"value": "",
"nameSize": 14,
"totalSize": 46
},
{
"name": "content-location",
"value": "",
"nameSize": 16,
"totalSize": 48
},
{
"name": "content-range",
"value": "",
"nameSize": 13,
"totalSize": 45
},
{
"name": "content-type",
"value": "",
"nameSize": 12,
"totalSize": 44
},
{
"name": "cookie",
"value": "",
"nameSize": 6,
"totalSize": 38
},
{
"name": "date",
"value": "",
"nameSize": 4,
"totalSize": 36
},
{
"name": "etag",
"value": "",
"nameSize": 4,
"totalSize": 36
},
{
"name": "expect",
"value": "",
"nameSize": 6,
"totalSize": 38
},
{
"name": "expires",
"value": "",
"nameSize": 7,
"totalSize": 39
},
{
"name": "from",
"value": "",
"nameSize": 4,
"totalSize": 36
},
{
"name": "host",
"value": "",
"nameSize": 4,
"totalSize": 36
},
{
"name": "if-match",
"value": "",
"nameSize": 8,
"totalSize": 40
},
{
"name": "if-modified-since",
"value": "",
"nameSize": 17,
"totalSize": 49
},
{
"name": "if-none-match",
"value": "",
"nameSize": 13,
"totalSize": 45
},
{
"name": "if-range",
"value": "",
"nameSize": 8,
"totalSize": 40
},
{
"name": "if-unmodified-since",
"value": "",
"nameSize": 19,
"totalSize": 51
},
{
"name": "last-modified",
"value": "",
"nameSize": 13,
"totalSize": 45
},
{
"name": "link",
"value": "",
"nameSize": 4,
"totalSize": 36
},
{
"name": "location",
"value": "",
"nameSize": 8,
"totalSize": 40
},
{
"name": "max-forwards",
"value": "",
"nameSize": 12,
"totalSize": 44
},
{
"name": "proxy-authenticate",
"value": "",
"nameSize": 18,
"totalSize": 50
},
{
"name": "proxy-authorization",
"value": "",
"nameSize": 19,
"totalSize": 51
},
{
"name": "range",
"value": "",
"nameSize": 5,
"totalSize": 37
},
{
"name": "referer",
"value": "",
"nameSize": 7,
"totalSize": 39
},
{
"name": "refresh",
"value": "",
"nameSize": 7,
"totalSize": 39
},
{
"name": "retry-after",
"value": "",
"nameSize": 11,
"totalSize": 43
},
{
"name": "server",
"value": "",
"nameSize": 6,
"totalSize": 38
},
{
"name": "set-cookie",
"value": "",
"nameSize": 10,
"totalSize": 42
},
{
"name": "strict-transport-security",
"value": "",
"nameSize": 25,
"totalSize": 57
},
{
"name": "transfer-encoding",
"value": "",
"nameSize": 17,
"totalSize": 49
},
{
"name": "user-agent",
"value": "",
"nameSize": 10,
"totalSize": 42
},
{
"name": "vary",
"value": "",
"nameSize": 4,
"totalSize": 36
},
{
"name": "via",
"value": "",
"nameSize": 3,
"totalSize": 35
},
{
"name": "www-authenticate",
"value": "",
"nameSize": 16,
"totalSize": 48
}
];
exports.map = {
":authority": {
"index": 1,
"values": {
"": 1
}
},
":method": {
"index": 2,
"values": {
"GET": 2,
"POST": 3
}
},
":path": {
"index": 4,
"values": {
"/": 4,
"/index.html": 5
}
},
":scheme": {
"index": 6,
"values": {
"http": 6,
"https": 7
}
},
":status": {
"index": 8,
"values": {
"200": 8,
"204": 9,
"206": 10,
"304": 11,
"400": 12,
"404": 13,
"500": 14
}
},
"accept-charset": {
"index": 15,
"values": {
"": 15
}
},
"accept-encoding": {
"index": 16,
"values": {
"gzip, deflate": 16
}
},
"accept-language": {
"index": 17,
"values": {
"": 17
}
},
"accept-ranges": {
"index": 18,
"values": {
"": 18
}
},
"accept": {
"index": 19,
"values": {
"": 19
}
},
"access-control-allow-origin": {
"index": 20,
"values": {
"": 20
}
},
"age": {
"index": 21,
"values": {
"": 21
}
},
"allow": {
"index": 22,
"values": {
"": 22
}
},
"authorization": {
"index": 23,
"values": {
"": 23
}
},
"cache-control": {
"index": 24,
"values": {
"": 24
}
},
"content-disposition": {
"index": 25,
"values": {
"": 25
}
},
"content-encoding": {
"index": 26,
"values": {
"": 26
}
},
"content-language": {
"index": 27,
"values": {
"": 27
}
},
"content-length": {
"index": 28,
"values": {
"": 28
}
},
"content-location": {
"index": 29,
"values": {
"": 29
}
},
"content-range": {
"index": 30,
"values": {
"": 30
}
},
"content-type": {
"index": 31,
"values": {
"": 31
}
},
"cookie": {
"index": 32,
"values": {
"": 32
}
},
"date": {
"index": 33,
"values": {
"": 33
}
},
"etag": {
"index": 34,
"values": {
"": 34
}
},
"expect": {
"index": 35,
"values": {
"": 35
}
},
"expires": {
"index": 36,
"values": {
"": 36
}
},
"from": {
"index": 37,
"values": {
"": 37
}
},
"host": {
"index": 38,
"values": {
"": 38
}
},
"if-match": {
"index": 39,
"values": {
"": 39
}
},
"if-modified-since": {
"index": 40,
"values": {
"": 40
}
},
"if-none-match": {
"index": 41,
"values": {
"": 41
}
},
"if-range": {
"index": 42,
"values": {
"": 42
}
},
"if-unmodified-since": {
"index": 43,
"values": {
"": 43
}
},
"last-modified": {
"index": 44,
"values": {
"": 44
}
},
"link": {
"index": 45,
"values": {
"": 45
}
},
"location": {
"index": 46,
"values": {
"": 46
}
},
"max-forwards": {
"index": 47,
"values": {
"": 47
}
},
"proxy-authenticate": {
"index": 48,
"values": {
"": 48
}
},
"proxy-authorization": {
"index": 49,
"values": {
"": 49
}
},
"range": {
"index": 50,
"values": {
"": 50
}
},
"referer": {
"index": 51,
"values": {
"": 51
}
},
"refresh": {
"index": 52,
"values": {
"": 52
}
},
"retry-after": {
"index": 53,
"values": {
"": 53
}
},
"server": {
"index": 54,
"values": {
"": 54
}
},
"set-cookie": {
"index": 55,
"values": {
"": 55
}
},
"strict-transport-security": {
"index": 56,
"values": {
"": 56
}
},
"transfer-encoding": {
"index": 57,
"values": {
"": 57
}
},
"user-agent": {
"index": 58,
"values": {
"": 58
}
},
"vary": {
"index": 59,
"values": {
"": 59
}
},
"via": {
"index": 60,
"values": {
"": 60
}
},
"www-authenticate": {
"index": 61,
"values": {
"": 61
}
}
};

85
app_vue/node_modules/hpack.js/lib/hpack/table.js generated vendored Normal file
View File

@ -0,0 +1,85 @@
var hpack = require('../hpack');
var utils = hpack.utils;
var assert = utils.assert;
function Table(options) {
this['static'] = hpack['static-table'];
this.dynamic = [];
this.size = 0;
this.maxSize = 0;
this.length = this['static'].table.length;
this.protocolMaxSize = options.maxSize;
this.maxSize = this.protocolMaxSize;
this.lookupDepth = options.lookupDepth || 32;
}
module.exports = Table;
Table.create = function create(options) {
return new Table(options);
};
Table.prototype.lookup = function lookup(index) {
assert(index !== 0, 'Zero indexed field');
assert(index <= this.length, 'Indexed field OOB')
if (index <= this['static'].table.length)
return this['static'].table[index - 1];
else
return this.dynamic[this.length - index];
};
Table.prototype.reverseLookup = function reverseLookup(name, value) {
var staticEntry = this['static'].map[name];
if (staticEntry && staticEntry.values[value])
return staticEntry.values[value];
// Reverse search dynamic table (new items are at the end of it)
var limit = Math.max(0, this.dynamic.length - this.lookupDepth);
for (var i = this.dynamic.length - 1; i >= limit; i--) {
var entry = this.dynamic[i];
if (entry.name === name && entry.value === value)
return this.length - i;
if (entry.name === name) {
// Prefer smaller index
if (staticEntry)
break;
return -(this.length - i);
}
}
if (staticEntry)
return -staticEntry.index;
return 0;
};
Table.prototype.add = function add(name, value, nameSize, valueSize) {
var totalSize = nameSize + valueSize + 32;
this.dynamic.push({
name: name,
value: value,
nameSize: nameSize,
totalSize: totalSize
});
this.size += totalSize;
this.length++;
this.evict();
};
Table.prototype.evict = function evict() {
while (this.size > this.maxSize) {
var entry = this.dynamic.shift();
this.size -= entry.totalSize;
this.length--;
}
assert(this.size >= 0, 'Table size sanity check failed');
};
Table.prototype.updateSize = function updateSize(size) {
assert(size <= this.protocolMaxSize, 'Table size bigger than maximum');
this.maxSize = size;
this.evict();
};

25
app_vue/node_modules/hpack.js/lib/hpack/utils.js generated vendored Normal file
View File

@ -0,0 +1,25 @@
exports.assert = function assert(cond, text) {
if (!cond)
throw new Error(text);
};
exports.stringify = function stringify(arr) {
var res = '';
for (var i = 0; i < arr.length; i++)
res += String.fromCharCode(arr[i]);
return res;
};
exports.toArray = function toArray(str) {
var res = [];
for (var i = 0; i < str.length; i++) {
var c = str.charCodeAt(i);
var hi = c >>> 8;
var lo = c & 0xff;
if (hi)
res.push(hi, lo);
else
res.push(lo);
}
return res;
};