服务器内存优化

This commit is contained in:
shuaiplus committed 2025-05-23 23:42:59 +08:00
1 parent 2fb0165323
commit 29c46c817d
6 files changed
+268 -193

No files matched your search

+5 -5
View File
@@ -811,7 +811,7 @@
},
"node_modules/aes-js": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz",
"resolved": "https://registry.npmmirror.com/aes-js/-/aes-js-3.1.2.tgz",
"integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==",
"license": "MIT"
},
@@ -849,7 +849,7 @@
},
"node_modules/buffer": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
"resolved": "https://registry.npmmirror.com/buffer/-/buffer-6.0.3.tgz",
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
"funding": [
{
@@ -887,7 +887,7 @@
},
"node_modules/elliptic": {
"version": "6.6.1",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz",
"resolved": "https://registry.npmmirror.com/elliptic/-/elliptic-6.6.1.tgz",
"integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==",
"license": "MIT",
"dependencies": {
@@ -1020,13 +1020,13 @@
},
"node_modules/js-chacha20": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/js-chacha20/-/js-chacha20-1.1.0.tgz",
"resolved": "https://registry.npmmirror.com/js-chacha20/-/js-chacha20-1.1.0.tgz",
"integrity": "sha512-ML5/rujYI/iYydrkIdf+JtUyjmiTWd4UgxNkEmIQ/rltgHzgtzlYJnnMETxPTFGnivEWynZca4YXUoZlxVtjqA==",
"license": "MIT"
},
"node_modules/js-sha256": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.11.0.tgz",
"resolved": "https://registry.npmmirror.com/js-sha256/-/js-sha256-0.11.0.tgz",
"integrity": "sha512-6xNlKayMZvds9h1Y1VWc0fQHQ82BxTXizWPEtEeGvmOUYpBRy4gbWroHLpzowe6xiQhHpelCQiE7HEdznyBL9Q==",
"license": "MIT"
},
+233 -164
View File
@@ -139,11 +139,9 @@ wss.on('connection', ( connection ) => {
}
// Update seen
clients[clientId].seen = getTime();
// Respond to ping requests
if (
message === 'ping'
) {
@@ -154,7 +152,6 @@ wss.on('connection', ( connection ) => {
logEvent('message', [ clientId, message ], 'debug');
// Receive client ecdh public key
if (
! clients[clientId].shared &&
message.length < 2048
@@ -191,154 +188,13 @@ wss.on('connection', ( connection ) => {
}
// Receive encrypted message from client
if (
clients[clientId].shared &&
message.length <= ( 8 * 1024 * 1024 )
) {
const decrypted = decryptMessage(message, clients[clientId].shared);
logEvent('message-decrypted', [ clientId, decrypted ], 'debug');
if (
! isObject(decrypted) ||
! isString(decrypted.a)
) {
return;
}
// Join channel
if (
decrypted.a === 'j' &&
isString(decrypted.p) &&
! clients[clientId].channel
) {
try {
const channel = decrypted.p;
// Set client channel
clients[clientId].channel = channel;
// Add client to channel
if (
! channels[channel]
) {
channels[channel] = [ clientId ];
} else {
channels[channel].push(clientId);
}
// Send channel client list (except themselves) to all clients in the channel
const members = channels[channel];
for (
const member of members
) {
const client = clients[member];
if (
isClientInChannel(client, channel)
) {
sendMessage(client.connection, encryptMessage({
a: 'l',
p: members.filter(( value ) => {
return(
value !== member
? true
: false
);
})
}, client.shared));
}
}
} catch ( error ) {
logEvent('message-join', [ clientId, error ], 'error');
}
return;
}
// Message client
if (
decrypted.a === 'c' &&
isString(decrypted.p) &&
isString(decrypted.c) &&
clients[clientId].channel
) {
try {
const channel = clients[clientId].channel;
const client = clients[decrypted.c];
if (
isClientInChannel(client, channel)
) {
sendMessage(client.connection, encryptMessage({
a: 'c',
p: decrypted.p,
c: clientId
}, client.shared));
}
} catch ( error ) {
logEvent('message-client', [ clientId, error ], 'error');
}
return;
}
// Message whole channel
if (
decrypted.a === 'w' &&
isObject(decrypted.p) &&
clients[clientId].channel
) {
try {
const channel = clients[clientId].channel;
for (
const member in decrypted.p
) {
const client = clients[member];
if (
isString(decrypted.p[member]) &&
isClientInChannel(client, channel)
) {
sendMessage(client.connection, encryptMessage({
a: 'c',
p: decrypted.p[member],
c: clientId
}, client.shared));
}
}
} catch ( error ) {
logEvent('message-channel', [ clientId, error ], 'error');
}
return;
}
// 立即处理并清理,避免在回调中持有大对象引用
processEncryptedMessage(clientId, message);
}
@@ -422,6 +278,173 @@ wss.on('connection', ( connection ) => {
});
// 将加密消息处理提取为独立函数,便于内存管理
const processEncryptedMessage = (clientId, message) => {
let decrypted = null;
try {
decrypted = decryptMessage(message, clients[clientId].shared);
logEvent('message-decrypted', [ clientId, decrypted ], 'debug');
if (
! isObject(decrypted) ||
! isString(decrypted.a)
) {
return;
}
// 根据消息类型分发处理
const action = decrypted.a;
if (action === 'j') {
handleJoinChannel(clientId, decrypted);
} else if (action === 'c') {
handleClientMessage(clientId, decrypted);
} else if (action === 'w') {
handleChannelMessage(clientId, decrypted);
}
} catch (error) {
logEvent('process-encrypted-message', [clientId, error], 'error');
} finally {
// 确保解密对象被立即清理
decrypted = null;
}
};
// 处理加入频道请求
const handleJoinChannel = (clientId, decrypted) => {
if (
! isString(decrypted.p) ||
clients[clientId].channel
) {
return;
}
try {
const channel = decrypted.p;
// Set client channel
clients[clientId].channel = channel;
// Add client to channel
if (! channels[channel]) {
channels[channel] = [ clientId ];
} else {
channels[channel].push(clientId);
}
// Send channel client list
broadcastMemberList(channel);
} catch (error) {
logEvent('message-join', [ clientId, error ], 'error');
}
};
// 处理客户端私聊消息
const handleClientMessage = (clientId, decrypted) => {
if (
! isString(decrypted.p) ||
! isString(decrypted.c) ||
! clients[clientId].channel
) {
return;
}
try {
const channel = clients[clientId].channel;
const targetClient = clients[decrypted.c];
if (isClientInChannel(targetClient, channel)) {
// 创建临时消息对象,发送后立即清理
const messageObj = {
a: 'c',
p: decrypted.p,
c: clientId
};
const encrypted = encryptMessage(messageObj, targetClient.shared);
sendMessage(targetClient.connection, encrypted);
// 清理临时对象
messageObj.p = null;
}
} catch (error) {
logEvent('message-client', [ clientId, error ], 'error');
}
};
// 处理频道广播消息
const handleChannelMessage = (clientId, decrypted) => {
if (
! isObject(decrypted.p) ||
! clients[clientId].channel
) {
return;
}
try {
const channel = clients[clientId].channel;
for (const member in decrypted.p) {
const targetClient = clients[member];
if (
isString(decrypted.p[member]) &&
isClientInChannel(targetClient, channel)
) {
// 创建临时消息对象
const messageObj = {
a: 'c',
p: decrypted.p[member],
c: clientId
};
const encrypted = encryptMessage(messageObj, targetClient.shared);
sendMessage(targetClient.connection, encrypted);
// 清理临时对象
messageObj.p = null;
}
}
} catch (error) {
logEvent('message-channel', [ clientId, error ], 'error');
}
};
// 广播成员列表
const broadcastMemberList = (channel) => {
try {
const members = channels[channel];
for (const member of members) {
const client = clients[member];
if (isClientInChannel(client, channel)) {
// 创建过滤后的成员列表
const filteredMembers = members.filter(value => value !== member);
const listObj = {
a: 'l',
p: filteredMembers
};
const encrypted = encryptMessage(listObj, client.shared);
sendMessage(client.connection, encrypted);
// 清理临时对象
listObj.p = null;
}
}
} catch (error) {
logEvent('broadcast-member-list', error, 'error');
}
};
/* ==================
HELPER FUNCTIONS
================== */
@@ -497,32 +520,24 @@ const sendMessage = ( connection, message ) => {
}
};
// Encrypt message
// Encrypt message - 简化内存优化
const encryptMessage = ( message, key ) => {
let encrypted = '';
try {
message = Buffer.from(JSON.stringify(message), 'utf8');
const messageBuffer = Buffer.from(JSON.stringify(message), 'utf8');
if (
( message.length % 16 ) !== 0
) {
message = Buffer.from([ ...message, ...Buffer.alloc(16 - ( message.length % 16 )) ]);
}
const paddedBuffer = ( messageBuffer.length % 16 ) !== 0
? Buffer.concat([messageBuffer, Buffer.alloc(16 - ( messageBuffer.length % 16 ))])
: messageBuffer;
const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv(
'aes-256-cbc',
key,
iv
);
const cipher = crypto.createCipheriv('aes-256-cbc', key, iv);
cipher.setAutoPadding(false);
encrypted = iv.toString('base64') + '|' + cipher.update(message, '', 'base64') + cipher.final('base64');
encrypted = iv.toString('base64') + '|' + cipher.update(paddedBuffer, '', 'base64') + cipher.final('base64');
} catch ( error ) {
logEvent('encryptMessage', error, 'error');
@@ -532,8 +547,7 @@ const encryptMessage = ( message, key ) => {
};
// Decrypt message
// Decrypt message - 简化内存优化
const decryptMessage = ( message, key ) => {
let decrypted = {};
@@ -549,7 +563,8 @@ const decryptMessage = ( message, key ) => {
decipher.setAutoPadding(false);
decrypted = JSON.parse(( decipher.update(parts[1], 'base64', 'utf8') + decipher.final('utf8') ).replace(/\0+$/, ''));
const decryptedText = decipher.update(parts[1], 'base64', 'utf8') + decipher.final('utf8');
decrypted = JSON.parse(decryptedText.replace(/\0+$/, ''));
} catch ( error ) {
logEvent('decryptMessage', error, 'error');
@@ -597,3 +612,57 @@ const isObject = ( value ) => {
: false
);
};
// =================== 内存监控 (测试用) ===================
let lastHeapUsed = 0;
let gcCounter = 0;
let lastClientCount = 0;
setInterval(() => {
const memUsage = process.memoryUsage();
const clientCount = Object.keys(clients).length;
const channelCount = Object.keys(channels).length;
const currentHeap = Math.round(memUsage.heapUsed / 1024 / 1024);
const heapDiff = currentHeap - lastHeapUsed;
console.log(`[MEMORY] RSS: ${Math.round(memUsage.rss / 1024 / 1024)}MB, Heap: ${currentHeap}MB/${Math.round(memUsage.heapTotal / 1024 / 1024)}MB (${heapDiff > 0 ? '+' : ''}${heapDiff}MB), External: ${Math.round(memUsage.external / 1024 / 1024)}MB, Clients: ${clientCount}, Channels: ${channelCount}`);
// 检测到客户端数量变化时立即触发GC
if (clientCount !== lastClientCount && global.gc) {
global.gc();
gcCounter++;
console.log(`[GC] Client change detected, triggered GC (#${gcCounter})`);
}
lastHeapUsed = currentHeap;
lastClientCount = clientCount;
}, 1000);
// 每30秒强制触发一次垃圾回收
setInterval(() => {
if (global.gc) {
global.gc();
gcCounter++;
console.log(`[GC] Periodic garbage collection triggered (#${gcCounter})`);
}
}, 30000);
// 进程退出时的清理
process.on('SIGINT', () => {
console.log('\n[CLEANUP] Server shutting down...');
if (global.gc) {
global.gc();
console.log('[CLEANUP] Final garbage collection performed');
}
process.exit(0);
});
process.on('SIGTERM', () => {
console.log('\n[CLEANUP] Server terminating...');
if (global.gc) {
global.gc();
console.log('[CLEANUP] Final garbage collection performed');
}
process.exit(0);
});
+27
View File
@@ -0,0 +1,27 @@
var Xa=Object.create;var Wr=Object.defineProperty;var $a=Object.getOwnPropertyDescriptor;var ja=Object.getOwnPropertyNames;var Va=Object.getPrototypeOf,Ya=Object.prototype.hasOwnProperty;var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Za=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of ja(e))!Ya.call(r,f)&&f!==t&&Wr(r,f,{get:()=>e[f],enumerable:!(a=$a(e,f))||a.enumerable});return r};var W0=(r,e,t)=>(t=r!=null?Xa(Va(r)):{},Za(e||!r||!r.__esModule?Wr(t,"default",{value:r,enumerable:!0}):t,r));var Lt=T(()=>{});var Tt=T(()=>{});var Xr=T((qc,Q0)=>{(function(){"use strict";var r="input is invalid type",e=typeof window=="object",t=e?window:{};t.JS_SHA256_NO_WINDOW&&(e=!1);var a=!e&&typeof self=="object",f=!t.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;f?t=global:a&&(t=self);var c=!t.JS_SHA256_NO_COMMON_JS&&typeof Q0=="object"&&Q0.exports,s=typeof define=="function"&&define.amd,b=!t.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",v="0123456789abcdef".split(""),_=[-2147483648,8388608,32768,128],m=[24,16,8,0],w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],F=["hex","array","digest","arrayBuffer"],B=[];(t.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(E){return Object.prototype.toString.call(E)==="[object Array]"}),b&&(t.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(E){return typeof E=="object"&&E.buffer&&E.buffer.constructor===ArrayBuffer});var P=function(E,q){return function(C){return new U(q,!0).update(C)[E]()}},N=function(E){var q=P("hex",E);f&&(q=D(q,E)),q.create=function(){return new U(E)},q.update=function(p){return q.create().update(p)};for(var C=0;C<F.length;++C){var R=F[C];q[R]=P(R,E)}return q},D=function(E,q){var C=Lt(),R=Tt().Buffer,p=q?"sha224":"sha256",i;R.from&&!t.JS_SHA256_NO_BUFFER_FROM?i=R.from:i=function(x){return new R(x)};var n=function(x){if(typeof x=="string")return C.createHash(p).update(x,"utf8").digest("hex");if(x==null)throw new Error(r);return x.constructor===ArrayBuffer&&(x=new Uint8Array(x)),Array.isArray(x)||ArrayBuffer.isView(x)||x.constructor===R?C.createHash(p).update(i(x)).digest("hex"):E(x)};return n},k=function(E,q){return function(C,R){return new Y(C,q,!0).update(R)[E]()}},$=function(E){var q=k("hex",E);q.create=function(p){return new Y(p,E)},q.update=function(p,i){return q.create(p).update(i)};for(var C=0;C<F.length;++C){var R=F[C];q[R]=k(R,E)}return q};function U(E,q){q?(B[0]=B[16]=B[1]=B[2]=B[3]=B[4]=B[5]=B[6]=B[7]=B[8]=B[9]=B[10]=B[11]=B[12]=B[13]=B[14]=B[15]=0,this.blocks=B):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=E}U.prototype.update=function(E){if(!this.finalized){var q,C=typeof E;if(C!=="string"){if(C==="object"){if(E===null)throw new Error(r);if(b&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!b||!ArrayBuffer.isView(E)))throw new Error(r)}else throw new Error(r);q=!0}for(var R,p=0,i,n=E.length,x=this.blocks;p<n;){if(this.hashed&&(this.hashed=!1,x[0]=this.block,this.block=x[16]=x[1]=x[2]=x[3]=x[4]=x[5]=x[6]=x[7]=x[8]=x[9]=x[10]=x[11]=x[12]=x[13]=x[14]=x[15]=0),q)for(i=this.start;p<n&&i<64;++p)x[i>>>2]|=E[p]<<m[i++&3];else for(i=this.start;p<n&&i<64;++p)R=E.charCodeAt(p),R<128?x[i>>>2]|=R<<m[i++&3]:R<2048?(x[i>>>2]|=(192|R>>>6)<<m[i++&3],x[i>>>2]|=(128|R&63)<<m[i++&3]):R<55296||R>=57344?(x[i>>>2]|=(224|R>>>12)<<m[i++&3],x[i>>>2]|=(128|R>>>6&63)<<m[i++&3],x[i>>>2]|=(128|R&63)<<m[i++&3]):(R=65536+((R&1023)<<10|E.charCodeAt(++p)&1023),x[i>>>2]|=(240|R>>>18)<<m[i++&3],x[i>>>2]|=(128|R>>>12&63)<<m[i++&3],x[i>>>2]|=(128|R>>>6&63)<<m[i++&3],x[i>>>2]|=(128|R&63)<<m[i++&3]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=x[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},U.prototype.finalize=function(){if(!this.finalized){this.finalizeLine truncated
/*! Bundled license information:
js-sha256/src/sha256.js:
(**
* [js-sha256]{@link https://github.com/emn178/js-sha256}
*
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2024
* @license MIT
*)
aes-js/index.js:
(*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. *)
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
*/
-21
View File
@@ -1,21 +0,0 @@
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,(function(r){var n=e[i][1][r];return o(n||r)}),p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){"use strict";exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i}revLookup["-".charCodeAt(0)]=62;revLookup["_".charCodeAt(0)]=63;function getLens(b64){var len=b64.length;if(len%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;var i;for(i=0;i<len;i+=4){tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)];arr[curByte++]=tmp>>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;i<end;i+=3){tmp=(uint8[i]<<16&16711680)+(uint8[i+1]<<8&65280)+(uint8[i+2]&255);output.push(tripletToBase64(tmp))}return output.join("")}function fromByteArray(uint8){var tmp;var len=uint8.length;var extraBytes=len%3;var parts=[];var maxChunkLength=16383;for(var i=0,len2=len-extraBytes;i<len2;i+=maxChunkLength){parts.push(encodeChunk(uint8,i,i+maxChunkLength>len2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}},{}],2:[function(require,module,exports){},{}],3:[function(require,module,exports){(function(Buffer){(function(){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
"use strict";var base64=require("base64-js");var ieee754=require("ieee754");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}var buf=new Uint8Array(length);buf.__proto__=Buffer.prototype;return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}if(typeof Symbol!=="undefined"&&Symbol.species!=null&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayLike(value)}if(value==null){throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}var valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}var b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}var length=byteLength(string,encoding)|0;var buf=createBuffer(length);var actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){var length=array.length<0?0:checked(array.length)|0;var buf=createBuffer(length);for(var i=0;i<length;i+=1){buf[i]=array[i]&255}return buf}function fromArrayBuffer(array,byteOffset,length){if(byteOffset<0||array.byteLength<byteOffset){throw new RangeError('"offset" is outside of buffer bounds')}if(array.byteLength<byteOffset+(length||0)){throw new RangeError('"length" is outside of buffer bounds')}var buf;if(byteOffset===undefined&&length===undefined){buf=new Uint8Array(array)}else if(length===undefined){buf=new Uint8Array(array,byteOffset)}else{buf=new Uint8Array(array,byteOffset,length)}buf.__proto__=Buffer.prototype;return buf}function fromObject(obj){if(Buffer.isBuffer(obj)){var len=checked(obj.length)|0;var buf=createBuffer(len);if(buf.length===0){return buf}obj.copy(buf,0,0,len);return buf}if(obj.length!==undefined){if(typeof obj.length!=="number"||numberIsNaN(obj.length)){return createBuffer(0)}return fromArrayLike(obj)}ifLine truncated
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128}},{}],5:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[]};process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],6:[function(require,module,exports){(function(Buffer){(function(){const sha256=require("js-sha256").sha256;const elliptic=require("elliptic").ec;const aes=require("aes-js");const chacha=require("js-chacha20");class ChatCrypt{constructor(config={},callbacks={}){this.config={rsaPublic:config.rsaPublic||"",wsAddress:config.wsAddress||"",reconnectDelay:config.reconnectDelay||3e3,pingInterval:config.pingInterval||2e4,debug:config.debug||false};this.callbacks={onServerClosed:callbacks.onServerClosed||null,onServerSecured:callbacks.onServerSecured||null,onClientSecured:callbacks.onClientSecured||null,onClientList:callbacks.onClientList||null,onClientMessage:callbacks.onClientMessage||null};try{this.clientEc=new elliptic("cLine truncated
/*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
(function(root){"use strict";function checkInt(value){return parseInt(value)===value}function checkInts(arrayish){if(!checkInt(arrayish.length)){return false}for(var i=0;i<arrayish.length;i++){if(!checkInt(arrayish[i])||arrayish[i]<0||arrayish[i]>255){return false}}return true}function coerceArray(arg,copy){if(arg.buffer&&arg.name==="Uint8Array"){if(copy){if(arg.slice){arg=arg.slice()}else{arg=Array.prototype.slice.call(arg)}}return arg}if(Array.isArray(arg)){if(!checkInts(arg)){throw new Error("Array contains invalid value: "+arg)}return new Uint8Array(arg)}if(checkInt(arg.length)&&checkInts(arg)){return new Uint8Array(arg)}throw new Error("unsupported array-like object")}function createArray(length){return new Uint8Array(length)}function copyArray(sourceArray,targetArray,targetStart,sourceStart,sourceEnd){if(sourceStart!=null||sourceEnd!=null){if(sourceArray.slice){sourceArray=sourceArray.slice(sourceStart,sourceEnd)}else{sourceArray=Array.prototype.slice.call(sourceArray,sourceStart,sourceEnd)}}targetArray.set(sourceArray,targetStart)}var convertUtf8=function(){function toBytes(text){var result=[],i=0;text=encodeURI(text);while(i<text.length){var c=text.charCodeAt(i++);if(c===37){result.push(parseInt(text.substr(i,2),16));i+=2}else{result.push(c)}}return coerceArray(result)}function fromBytes(bytes){var result=[],i=0;while(i<bytes.length){var c=bytes[i];if(c<128){result.push(String.fromCharCode(c));i++}else if(c>191&&c<224){result.push(String.fromCharCode((c&31)<<6|bytes[i+1]&63));i+=2}else{result.push(String.fromCharCode((c&15)<<12|(bytes[i+1]&63)<<6|bytes[i+2]&63));i+=3}}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var convertHex=function(){function toBytes(text){var result=[];for(var i=0;i<text.length;i+=2){result.push(parseInt(text.substr(i,2),16))}return result}var Hex="0123456789abcdef";function fromBytes(bytes){var result=[];for(var i=0;i<bytes.length;i++){var v=bytes[i];result.push(Hex[(v&240)>>4]+Hex[v&15])}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var numberOfRounds={16:10,24:12,32:14};var rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145];var S=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22];var Si=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125];var T1=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,35637Line truncated
/**
* [js-sha256]{@link https://github.com/emn178/js-sha256}
*
* @version 0.9.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
*/
(function(){"use strict";var ERROR="input is invalid type";var WINDOW=typeof window==="object";var root=WINDOW?window:{};if(root.JS_SHA256_NO_WINDOW){WINDOW=false}var WEB_WORKER=!WINDOW&&typeof self==="object";var NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process==="object"&&process.versions&&process.versions.node;if(NODE_JS){root=global}else if(WEB_WORKER){root=self}var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module==="object"&&module.exports;var AMD=typeof define==="function"&&define.amd;var ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!=="undefined";var HEX_CHARS="0123456789abcdef".split("");var EXTRA=[-2147483648,8388608,32768,128];var SHIFT=[24,16,8,0];var K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];var OUTPUT_TYPES=["hex","array","digest","arrayBuffer"];var blocks=[];if(root.JS_SHA256_NO_NODE_JS||!Array.isArray){Array.isArray=function(obj){return Object.prototype.toString.call(obj)==="[object Array]"}}if(ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)){ArrayBuffer.isView=function(obj){return typeof obj==="object"&&obj.buffer&&obj.buffer.constructor===ArrayBuffer}}var createOutputMethod=function(outputType,is224){return function(message){return new Sha256(is224,true).update(message)[outputType]()}};var createMethod=function(is224){var method=createOutputMethod("hex",is224);if(NODE_JS){method=nodeWrap(method,is224)}method.create=function(){return new Sha256(is224)};method.update=function(message){return method.create().update(message)};for(var i=0;i<OUTPUT_TYPES.length;++i){var type=OUTPUT_TYPES[i];method[type]=createOutputMethod(type,is224)}return method};var nodeWrap=function(method,is224){var crypto=eval("require('crypto')");var Buffer=eval("require('buffer').Buffer");var algorithm=is224?"sha224":"sha256";var nodeMethod=function(message){if(typeof message==="string"){return crypto.createHash(algorithm).update(message,"utf8").digest("hex")}else{if(message===null||message===undefined){throw new Error(ERROR)}else if(message.constructor===ArrayBuffer){message=new Uint8Array(message)}}if(Array.isArray(message)||ArrayBuffer.isView(message)||message.constructor===Buffer){return crypto.createHash(algorithm).update(new Buffer(message)).digest("hex")}else{return method(message)}};return nodeMethod};var createHmacOutputMethod=function(outputType,is224){return function(key,message){return new HmacSha256(key,is224,true).update(message)[outputType]()}};var createHmacMethod=function(is224){var method=createHmacOutputMethod("hex",is224);method.create=function(key){return new HmacSha256(key,is224)};method.update=function(key,message){return method.create(key).update(message)};for(var i=0;i<OUTPUT_TYPES.length;++i){var type=OUTPUT_TYPES[i];method[type]=createHmacOutputMethod(type,is224)}return method};function Sha256(is224,sharedMemory){if(sharedMemory){blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0;this.blocks=blocks}else{this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}if(is224){this.h0=3238371032;this.h1=914150663;this.h2=812702999;this.h3=4144912697;this.h4=4290775857;this.h5=1750603025;this.h6=1694076839;this.h7=3204075428}else{this.h0=1779033703;this.h1=3144134277;this.h2=1013904242;this.h3=2773480762;this.h4=1359893119;this.h5=2600822924;this.h6=528734635;this.h7=1541459225}this.block=this.start=this.bytes=this.hBytes=0;this.finalized=this.hashed=false;this.first=true;this.is224=is224}Sha256.prototype.update=function(message){if(this.finalized){return}var notString,type=typeof message;if(type!=="string"){if(type==="object"){if(message===null){throw new Error(ERROR)}else if(ARRAY_BUFFER&&message.constructor===ArrayBuffer){message=new Uint8Array(message)}else if(!Array.isArray(message)){if(!ARRAY_BUFFER||!ArrayBuffer.isView(message)){throw new Error(ERROR)}}}else{throw new Error(ERROR)}notString=true}var code,index=0,i,length=message.length,blocks=this.blocks;while(index<length){if(this.hashed){this.hashed=false;blocks[0]=this.block;blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0}if(notString){for(i=this.start;index<length&&i<64;++index){blocks[i>>2]|=message[index]<<SHIFT[i+Line truncated
+1 -1
View File
@@ -91,6 +91,6 @@
</div>
</div>
</div> <script type="module" src="./main.js"></script>
<!-- <script src="./NodeCrypt2.js"></script> -->
<script src="./NodeCrypt.bundle.js"></script>
</body>
</html>
+2 -2
View File
@@ -10,7 +10,7 @@ import { openSettingsPanel, closeSettingsPanel, initSettings, notifyMessage } fr
import { escapeHTML, textToHTML } from './util.string.js';
import { $, $$, $id, on, off, addClass, removeClass } from './util.dom.js';
import './NodeCrypt.js';
// import './NodeCrypt.js';
// === 核心功能模块导入 ===
import {
@@ -49,7 +49,7 @@ import {
* debug: 是否开启调试模式
*/
window.config = {
wsAddress: '/ws',
wsAddress: 'ws://127.0.0.1:8088',
debug: true
};