Update index.js
Browse files
index.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
const _0x430712=_0x37e3;(function(_0x1bb8e9,_0x149528){const _0x52b67d=_0x37e3,_0x55fa43=_0x1bb8e9();while(!![]){try{const _0x1bfd81=parseInt(_0x52b67d(0x128))/0x1*(-parseInt(_0x52b67d(0x13c))/0x2)+-parseInt(_0x52b67d(0x134))/0x3*(-parseInt(_0x52b67d(0x15e))/0x4)+parseInt(_0x52b67d(0x13b))/0x5*(-parseInt(_0x52b67d(0x144))/0x6)+-parseInt(_0x52b67d(0x178))/0x7+-parseInt(_0x52b67d(0x16b))/0x8+parseInt(_0x52b67d(0x168))/0x9*(parseInt(_0x52b67d(0x160))/0xa)+-parseInt(_0x52b67d(0x142))/0xb*(-parseInt(_0x52b67d(0x17e))/0xc);if(_0x1bfd81===_0x149528)break;else _0x55fa43['push'](_0x55fa43['shift']());}catch(_0x728e0){_0x55fa43['push'](_0x55fa43['shift']());}}}(_0xbabb,0x509b0));const http=require(_0x430712(0x155)),https=require('https'),fs=require('fs'),axios=require(_0x430712(0x14a)),net=require(_0x430712(0x183)),path=require('path'),crypto=require(_0x430712(0x133)),{Buffer}=require(_0x430712(0x149)),{WebSocket,createWebSocketStream}=require('ws');function generateUUID(){return crypto['randomUUID']();}const UUID=process[_0x430712(0x185)]['UUID']||generateUUID(),DOMAIN=process['env'][_0x430712(0x139)]||_0x430712(0x15b),WSPATH=process['env'][_0x430712(0x182)]||UUID[_0x430712(0x156)](0x0,0x8),SUB_PATH=process[_0x430712(0x185)][_0x430712(0x16c)]||_0x430712(0x158),NAME=process[_0x430712(0x185)][_0x430712(0x14c)]||'',PORT=process[_0x430712(0x185)][_0x430712(0x162)]||0x1eb4,TLS_KEY_PATH=process[_0x430712(0x185)][_0x430712(0x16d)]||'',TLS_CERT_PATH=process[_0x430712(0x185)]['TLS_CERT_PATH']||'';function _0x37e3(_0x2f4def,_0x391ab6){_0x2f4def=_0x2f4def-0x128;const _0xbabbc8=_0xbabb();let _0x37e385=_0xbabbc8[_0x2f4def];return _0x37e385;}let ISP='';const GetISP=async()=>{const _0x5d3739=_0x430712;try{const _0x1e7612=await axios[_0x5d3739(0x17a)](_0x5d3739(0x17c)),_0x58d83b=_0x1e7612[_0x5d3739(0x17d)];ISP=(_0x58d83b[_0x5d3739(0x172)]+'-'+_0x58d83b['isp'])[_0x5d3739(0x171)](/ /g,'_');}catch(_0x4b3491){ISP='Unknown';}};GetISP();function normalizeSecret(_0x11352a){if(!_0x11352a)return'';return _0x11352a['includes']('\x5cn')?_0x11352a['replace'](/\\n/g,'\x0a'):_0x11352a;}function _0xbabb(){const _0x41e117=['https://api.ip.sb/geoip','data','79164dfdksO','listen','every','Not\x20Found\x0a','WSPATH','net','connection','env','find','2oDkwWQ','send','url','Both\x20TLS\x20key\x20and\x20certificate\x20are\x20required;\x20falling\x20back\x20to\x20HTTP.','length','HTTP/WS','utf8','1.1.1.1','readUInt8','write','&path=%2F','crypto','3DvvQzk','trojan://','end','Failed\x20to\x20resolve\x20','Hello\x20world!','DOMAIN','error','1106035zxnmus','129462QbsUJr','substr','&type=A','hex','sha224','createHash','1287GCTPgH','map','6oaYxsf','reduce','isAbsolute','message','decode','buffer','axios','connect','NAME','from','?security=tls&sni=','concat','Server\x20is\x20running\x20on\x20','join','\x20with\x20all\x20DNS\x20servers','vless://','?encryption=none&security=tls&sni=','http','slice','update','yukuii','base64','application/dns-json','https://yukuii-coding.hf.space','writeHead','then','374212snYhbQ','text/html','20uZZvqF','catch','PORT','toString','readFileSync','close','text/plain','once','1940211cXPfzl','TLS_KEY','8.8.4.4','3378168IEBOQN','SUB_PATH','TLS_KEY_PATH','&fp=chrome&type=ws&host=','warn','Answer','replace','country_code','pipe','createServer','test','Failed\x20to\x20read\x20TLS\x20file\x20','readUInt16BE','1354220OSZgas','Server','get','digest'];_0xbabb=function(){return _0x41e117;};return _0xbabb();}function readOptionalFile(_0x38d05d){const _0x3ec1e0=_0x430712;if(!_0x38d05d)return'';const _0x57e195=path[_0x3ec1e0(0x146)](_0x38d05d)?_0x38d05d:path[_0x3ec1e0(0x151)](__dirname,_0x38d05d);try{return fs[_0x3ec1e0(0x164)](_0x57e195,_0x3ec1e0(0x12e));}catch(_0x45e1f7){return console['warn'](_0x3ec1e0(0x176)+_0x57e195+':\x20'+_0x45e1f7[_0x3ec1e0(0x147)]),'';}}function getTLSOptions(){const _0x4fa5ca=_0x430712;let _0x51a857=normalizeSecret(process['env'][_0x4fa5ca(0x169)]),_0xaf7bd4=normalizeSecret(process[_0x4fa5ca(0x185)]['TLS_CERT']);!_0x51a857&&(_0x51a857=readOptionalFile(TLS_KEY_PATH));!_0xaf7bd4&&(_0xaf7bd4=readOptionalFile(TLS_CERT_PATH));if(_0x51a857&&_0xaf7bd4)return{'key':_0x51a857,'cert':_0xaf7bd4};return(_0x51a857||_0xaf7bd4)&&console[_0x4fa5ca(0x16f)](_0x4fa5ca(0x12b)),null;}const requestHandler=(_0x583349,_0x175c8c)=>{const _0x32b6d0=_0x430712;if(_0x583349[_0x32b6d0(0x12a)]==='/'){const _0x2648d0=path[_0x32b6d0(0x151)](__dirname,'index.html');fs['readFile'](_0x2648d0,_0x32b6d0(0x12e),(_0x137236,_0xc5b867)=>{const _0x330afc=_0x32b6d0;if(_0x137236){_0x175c8c['writeHead'](0xc8,{'Content-Type':_0x330afc(0x15f)}),_0x175c8c[_0x330afc(0x136)](_0x330afc(0x138));return;}_0x175c8c['writeHead'](0xc8,{'Content-Type':_0x330afc(0x15f)}),_0x175c8c['end'](_0xc5b867);});return;}else{if(_0x583349[_0x32b6d0(0x12a)]==='/'+SUB_PATH){const _0x4ca9e8=NAME?NAME+'-'+ISP:ISP,_0x3bc407=_0x32b6d0(0x153)+UUID+'@'+DOMAIN+_0x32b6d0(0x154)+DOMAIN+_0x32b6d0(0x16e)+DOMAIN+_0x32b6d0(0x132)+WSPATH+'#'+_0x4ca9e8,_0x1ec6c5=_0x32b6d0(0x135)+UUID+'@'+DOMAIN+_0x32b6d0(0x14e)+DOMAIN+_0x32b6d0(0x16e)+DOMAIN+_0x32b6d0(0x132)+WSPATH+'#'+_0x4ca9e8,_0x57b177=_0x3bc407+'\x0a'+_0x1ec6c5,_0x2b5606=Buffer[_0x32b6d0(0x14d)](_0x57b177)[_0x32b6d0(0x163)](_0x32b6d0(0x159));_0x175c8c[_0x32b6d0(0x15c)](0xc8,{'Content-Type':'text/plain'}),_0x175c8c[_0x32b6d0(0x136)](_0x2b5606+'\x0a');}else _0x175c8c[_0x32b6d0(0x15c)](0x194,{'Content-Type':_0x32b6d0(0x166)}),_0x175c8c[_0x32b6d0(0x136)](_0x32b6d0(0x181));}},tlsOptions=getTLSOptions(),httpServer=tlsOptions?https['createServer'](tlsOptions,requestHandler):http[_0x430712(0x174)](requestHandler),wss=new WebSocket[(_0x430712(0x179))]({'server':httpServer}),uuid=UUID[_0x430712(0x171)](/-/g,''),DNS_SERVERS=[_0x430712(0x16a),_0x430712(0x12f)];function resolveHost(_0x55cb73){return new Promise((_0x145c03,_0x20d4f1)=>{const _0x559be0=_0x37e3;if(/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/[_0x559be0(0x175)](_0x55cb73)){_0x145c03(_0x55cb73);return;}let _0x9ebe88=0x0;function _0x3b4526(){const _0x50e01e=_0x559be0;if(_0x9ebe88>=DNS_SERVERS[_0x50e01e(0x12c)]){_0x20d4f1(new Error(_0x50e01e(0x137)+_0x55cb73+_0x50e01e(0x152)));return;}const _0x9e1a50=DNS_SERVERS[_0x9ebe88];_0x9ebe88++;const _0x1f9c8b='https://dns.google/resolve?name='+encodeURIComponent(_0x55cb73)+_0x50e01e(0x13e);axios[_0x50e01e(0x17a)](_0x1f9c8b,{'timeout':0x1388,'headers':{'Accept':_0x50e01e(0x15a)}})[_0x50e01e(0x15d)](_0x3ff33e=>{const _0x2bf319=_0x50e01e,_0x5ce6ca=_0x3ff33e[_0x2bf319(0x17d)];if(_0x5ce6ca['Status']===0x0&&_0x5ce6ca['Answer']&&_0x5ce6ca[_0x2bf319(0x170)]['length']>0x0){const _0x12acaf=_0x5ce6ca[_0x2bf319(0x170)][_0x2bf319(0x186)](_0x114ab8=>_0x114ab8['type']===0x1);if(_0x12acaf){_0x145c03(_0x12acaf[_0x2bf319(0x17d)]);return;}}_0x3b4526();})[_0x50e01e(0x161)](_0x56b699=>{_0x3b4526();});}_0x3b4526();});}function handleVlessConnection(_0x4a8d1a,_0x38c538){const _0x125cb0=_0x430712,[_0x400027]=_0x38c538,_0x491a56=_0x38c538[_0x125cb0(0x156)](0x1,0x11);if(!_0x491a56[_0x125cb0(0x180)]((_0x384781,_0x3115fa)=>_0x384781==parseInt(uuid[_0x125cb0(0x13d)](_0x3115fa*0x2,0x2),0x10)))return![];let _0x142c35=_0x38c538[_0x125cb0(0x156)](0x11,0x12)[_0x125cb0(0x130)]()+0x13;const _0x45ee5e=_0x38c538['slice'](_0x142c35,_0x142c35+=0x2)[_0x125cb0(0x177)](0x0),_0x36cefe=_0x38c538[_0x125cb0(0x156)](_0x142c35,_0x142c35+=0x1)['readUInt8'](),_0x1231b7=_0x36cefe==0x1?_0x38c538[_0x125cb0(0x156)](_0x142c35,_0x142c35+=0x4)[_0x125cb0(0x151)]('.'):_0x36cefe==0x2?new TextDecoder()[_0x125cb0(0x148)](_0x38c538[_0x125cb0(0x156)](_0x142c35+0x1,_0x142c35+=0x1+_0x38c538[_0x125cb0(0x156)](_0x142c35,_0x142c35+0x1)[_0x125cb0(0x130)]())):_0x36cefe==0x3?_0x38c538[_0x125cb0(0x156)](_0x142c35,_0x142c35+=0x10)[_0x125cb0(0x145)]((_0x7d8ec6,_0x743e8f,_0xdbb7e8,_0x1879f6)=>_0xdbb7e8%0x2?_0x7d8ec6[_0x125cb0(0x14f)](_0x1879f6[_0x125cb0(0x156)](_0xdbb7e8-0x1,_0xdbb7e8+0x1)):_0x7d8ec6,[])['map'](_0x5ed4ac=>_0x5ed4ac['readUInt16BE'](0x0)[_0x125cb0(0x163)](0x10))[_0x125cb0(0x151)](':'):'';_0x4a8d1a[_0x125cb0(0x129)](new Uint8Array([_0x400027,0x0]));const _0x17bb3c=createWebSocketStream(_0x4a8d1a);return resolveHost(_0x1231b7)['then'](_0x187a0d=>{const _0xdbc0ed=_0x125cb0;net[_0xdbc0ed(0x14b)]({'host':_0x187a0d,'port':_0x45ee5e},function(){const _0x5b1301=_0xdbc0ed;this[_0x5b1301(0x131)](_0x38c538[_0x5b1301(0x156)](_0x142c35)),_0x17bb3c['on'](_0x5b1301(0x13a),()=>{})[_0x5b1301(0x173)](this)['on'](_0x5b1301(0x13a),()=>{})[_0x5b1301(0x173)](_0x17bb3c);})['on']('error',()=>{});})[_0x125cb0(0x161)](_0x4e8935=>{const _0x50cc99=_0x125cb0;net[_0x50cc99(0x14b)]({'host':_0x1231b7,'port':_0x45ee5e},function(){const _0x455d23=_0x50cc99;this[_0x455d23(0x131)](_0x38c538[_0x455d23(0x156)](_0x142c35)),_0x17bb3c['on'](_0x455d23(0x13a),()=>{})['pipe'](this)['on'](_0x455d23(0x13a),()=>{})[_0x455d23(0x173)](_0x17bb3c);})['on'](_0x50cc99(0x13a),()=>{});}),!![];}function handleTrojanConnection(_0x6f01a5,_0x43a7a5){const _0x491f31=_0x430712;try{if(_0x43a7a5[_0x491f31(0x12c)]<0x3a)return![];const _0xe8fd80=_0x43a7a5[_0x491f31(0x156)](0x0,0x38)[_0x491f31(0x163)](),_0x18e916=[UUID];let _0x593362=null;for(const _0x45a805 of _0x18e916){const _0x1f8e94=crypto[_0x491f31(0x141)](_0x491f31(0x140))[_0x491f31(0x157)](_0x45a805)[_0x491f31(0x17b)](_0x491f31(0x13f));if(_0x1f8e94===_0xe8fd80){_0x593362=_0x45a805;break;}}if(!_0x593362)return![];let _0x4397bb=0x38;_0x43a7a5[_0x4397bb]===0xd&&_0x43a7a5[_0x4397bb+0x1]===0xa&&(_0x4397bb+=0x2);const _0x53d211=_0x43a7a5[_0x4397bb];if(_0x53d211!==0x1)return![];_0x4397bb+=0x1;const _0x46845c=_0x43a7a5[_0x4397bb];_0x4397bb+=0x1;let _0x46cc7b,_0x2a9e3e;if(_0x46845c===0x1)_0x46cc7b=_0x43a7a5[_0x491f31(0x156)](_0x4397bb,_0x4397bb+0x4)[_0x491f31(0x151)]('.'),_0x4397bb+=0x4;else{if(_0x46845c===0x3){const _0x2a95c4=_0x43a7a5[_0x4397bb];_0x4397bb+=0x1,_0x46cc7b=_0x43a7a5['slice'](_0x4397bb,_0x4397bb+_0x2a95c4)[_0x491f31(0x163)](),_0x4397bb+=_0x2a95c4;}else{if(_0x46845c===0x4)_0x46cc7b=_0x43a7a5[_0x491f31(0x156)](_0x4397bb,_0x4397bb+0x10)[_0x491f31(0x145)]((_0x47dce2,_0x3e275d,_0x1035da,_0x200e93)=>_0x1035da%0x2?_0x47dce2['concat'](_0x200e93[_0x491f31(0x156)](_0x1035da-0x1,_0x1035da+0x1)):_0x47dce2,[])[_0x491f31(0x143)](_0xd6eddd=>_0xd6eddd['readUInt16BE'](0x0)[_0x491f31(0x163)](0x10))[_0x491f31(0x151)](':'),_0x4397bb+=0x10;else return![];}}_0x2a9e3e=_0x43a7a5['readUInt16BE'](_0x4397bb),_0x4397bb+=0x2;_0x4397bb<_0x43a7a5[_0x491f31(0x12c)]&&_0x43a7a5[_0x4397bb]===0xd&&_0x43a7a5[_0x4397bb+0x1]===0xa&&(_0x4397bb+=0x2);const _0x17f630=createWebSocketStream(_0x6f01a5);return resolveHost(_0x46cc7b)[_0x491f31(0x15d)](_0x6750d7=>{const _0xc4b303=_0x491f31;net[_0xc4b303(0x14b)]({'host':_0x6750d7,'port':_0x2a9e3e},function(){const _0x4234f4=_0xc4b303;_0x4397bb<_0x43a7a5[_0x4234f4(0x12c)]&&this[_0x4234f4(0x131)](_0x43a7a5[_0x4234f4(0x156)](_0x4397bb)),_0x17f630['on'](_0x4234f4(0x13a),()=>{})[_0x4234f4(0x173)](this)['on'](_0x4234f4(0x13a),()=>{})[_0x4234f4(0x173)](_0x17f630);})['on']('error',()=>{});})[_0x491f31(0x161)](_0x24dc4b=>{const _0x59a76e=_0x491f31;net['connect']({'host':_0x46cc7b,'port':_0x2a9e3e},function(){const _0x4f3f91=_0x37e3;_0x4397bb<_0x43a7a5['length']&&this[_0x4f3f91(0x131)](_0x43a7a5['slice'](_0x4397bb)),_0x17f630['on']('error',()=>{})[_0x4f3f91(0x173)](this)['on'](_0x4f3f91(0x13a),()=>{})[_0x4f3f91(0x173)](_0x17f630);})['on'](_0x59a76e(0x13a),()=>{});}),!![];}catch(_0x59e84e){return![];}}wss['on'](_0x430712(0x184),(_0xfe26c8,_0x10223b)=>{const _0x330b56=_0x430712,_0x2b442a=_0x10223b[_0x330b56(0x12a)]||'';_0xfe26c8[_0x330b56(0x167)](_0x330b56(0x147),_0x4d21e0=>{const _0x4a849f=_0x330b56;if(_0x4d21e0[_0x4a849f(0x12c)]>0x11&&_0x4d21e0[0x0]===0x0){const _0x24127a=_0x4d21e0[_0x4a849f(0x156)](0x1,0x11),_0x108aa4=_0x24127a[_0x4a849f(0x180)]((_0x4a9df4,_0x92b109)=>_0x4a9df4==parseInt(uuid[_0x4a849f(0x13d)](_0x92b109*0x2,0x2),0x10));if(_0x108aa4){!handleVlessConnection(_0xfe26c8,_0x4d21e0)&&_0xfe26c8[_0x4a849f(0x165)]();return;}}!handleTrojanConnection(_0xfe26c8,_0x4d21e0)&&_0xfe26c8[_0x4a849f(0x165)]();})['on'](_0x330b56(0x13a),()=>{});}),httpServer[_0x430712(0x17f)](PORT,()=>{const _0x4ec63d=_0x430712,_0x2adebe=tlsOptions?'HTTPS/WSS':_0x4ec63d(0x12d);console['log'](_0x4ec63d(0x150)+_0x2adebe+'\x20port\x20'+PORT);});
|
|
|
|
| 1 |
+
const _0x1711a5=_0x4b46;(function(_0x3a7e19,_0x1088f5){const _0x1341c5=_0x4b46,_0x2b6673=_0x3a7e19();while(!![]){try{const _0x48518f=-parseInt(_0x1341c5(0x130))/0x1+-parseInt(_0x1341c5(0x141))/0x2+parseInt(_0x1341c5(0x157))/0x3+parseInt(_0x1341c5(0x153))/0x4*(-parseInt(_0x1341c5(0x109))/0x5)+-parseInt(_0x1341c5(0x12e))/0x6*(parseInt(_0x1341c5(0x15e))/0x7)+parseInt(_0x1341c5(0x14d))/0x8+-parseInt(_0x1341c5(0x156))/0x9*(-parseInt(_0x1341c5(0x15f))/0xa);if(_0x48518f===_0x1088f5)break;else _0x2b6673['push'](_0x2b6673['shift']());}catch(_0x4dd0fd){_0x2b6673['push'](_0x2b6673['shift']());}}}(_0x5dc2,0x3d29c));const http=require(_0x1711a5(0x163)),https=require(_0x1711a5(0x12b)),fs=require('fs'),axios=require(_0x1711a5(0x116)),net=require('net'),path=require(_0x1711a5(0x110)),crypto=require(_0x1711a5(0x135)),{Buffer}=require(_0x1711a5(0x139)),{WebSocket,createWebSocketStream}=require('ws');function generateUUID(){return crypto['randomUUID']();}const UUID=process[_0x1711a5(0x160)]['UUID']||generateUUID(),DOMAIN=process[_0x1711a5(0x160)][_0x1711a5(0x15a)]||'yukuii-coding.hf.space',WSPATH=process['env'][_0x1711a5(0x149)]||UUID[_0x1711a5(0x128)](0x0,0x8),SUB_PATH=process[_0x1711a5(0x160)][_0x1711a5(0x113)]||_0x1711a5(0x13a),NAME=process[_0x1711a5(0x160)][_0x1711a5(0x143)]||'',PORT=process['env']['PORT']||0x1eb4,TLS_KEY_PATH=process[_0x1711a5(0x160)][_0x1711a5(0x147)]||'',TLS_CERT_PATH=process[_0x1711a5(0x160)]['TLS_CERT_PATH']||'';function _0x5dc2(){const _0xa523ca=['408855YUcfFO','decode','TLS_CERT','DOMAIN','connection','Server\x20is\x20running\x20on\x20','createHash','7AlyTqC','2580exVmRR','env','then','length','http','1.1.1.1','Failed\x20to\x20resolve\x20','country_code','1205nOfgeU','data','?security=tls&sni=','createServer','Status','replace','HTTP/WS','path','text/plain','message','SUB_PATH','test','base64','axios','catch','log','find','Unknown','hex','\x20port\x20','readUInt16BE','send','readFile','isAbsolute','error','isp','join','map','readFileSync','digest','Server','slice','substr','end','https','index.html','get','307434hYRqpt','Answer','91609wPjRIi','type','sha224','warn','utf8','crypto','https://dns.google/resolve?name=','&fp=chrome&type=ws&host=','write','buffer','yukuii','url','reduce','close','connect','HTTPS/WSS','listen','872248Oldmze','Failed\x20to\x20read\x20TLS\x20file\x20','NAME','concat','every','trojan://','TLS_KEY_PATH','from','WSPATH','text/html','&path=%2F','&type=A','3588592IRcqIY','writeHead','pipe','readUInt8','toString','Both\x20TLS\x20key\x20and\x20certificate\x20are\x20required;\x20falling\x20back\x20to\x20HTTP.','6508SXJZnJ','Not\x20Found\x0a','includes','22212NrdHOJ'];_0x5dc2=function(){return _0xa523ca;};return _0x5dc2();}let ISP='';const GetISP=async()=>{const _0x3023e8=_0x1711a5;try{const _0x242bc0=await axios[_0x3023e8(0x12d)]('https://api.ip.sb/geoip'),_0x1cab3a=_0x242bc0[_0x3023e8(0x10a)];ISP=(_0x1cab3a[_0x3023e8(0x108)]+'-'+_0x1cab3a[_0x3023e8(0x122)])[_0x3023e8(0x10e)](/ /g,'_');}catch(_0x10ae99){ISP=_0x3023e8(0x11a);}};GetISP();function normalizeSecret(_0x187661){const _0x43111f=_0x1711a5;if(!_0x187661)return'';return _0x187661[_0x43111f(0x155)]('\x5cn')?_0x187661[_0x43111f(0x10e)](/\\n/g,'\x0a'):_0x187661;}function readOptionalFile(_0x2e1865){const _0x47e5cd=_0x1711a5;if(!_0x2e1865)return'';const _0x455c0d=path[_0x47e5cd(0x120)](_0x2e1865)?_0x2e1865:path[_0x47e5cd(0x123)](__dirname,_0x2e1865);try{return fs[_0x47e5cd(0x125)](_0x455c0d,'utf8');}catch(_0x2fe968){return console[_0x47e5cd(0x133)](_0x47e5cd(0x142)+_0x455c0d+':\x20'+_0x2fe968[_0x47e5cd(0x112)]),'';}}function getTLSOptions(){const _0x5b15b5=_0x1711a5;let _0x3f8d3f=normalizeSecret(process[_0x5b15b5(0x160)]['TLS_KEY']),_0x1db736=normalizeSecret(process[_0x5b15b5(0x160)][_0x5b15b5(0x159)]);!_0x3f8d3f&&(_0x3f8d3f=readOptionalFile(TLS_KEY_PATH));!_0x1db736&&(_0x1db736=readOptionalFile(TLS_CERT_PATH));if(_0x3f8d3f&&_0x1db736)return{'key':_0x3f8d3f,'cert':_0x1db736};return(_0x3f8d3f||_0x1db736)&&console[_0x5b15b5(0x133)](_0x5b15b5(0x152)),null;}const requestHandler=(_0x8fb37a,_0x352a7a)=>{const _0x5bd326=_0x1711a5;if(_0x8fb37a[_0x5bd326(0x13b)]==='/'){const _0x25561d=path[_0x5bd326(0x123)](__dirname,_0x5bd326(0x12c));fs[_0x5bd326(0x11f)](_0x25561d,_0x5bd326(0x134),(_0x28dc0a,_0x3e8ad2)=>{const _0x59c9d2=_0x5bd326;if(_0x28dc0a){_0x352a7a[_0x59c9d2(0x14e)](0xc8,{'Content-Type':_0x59c9d2(0x14a)}),_0x352a7a[_0x59c9d2(0x12a)]('Hello\x20world!');return;}_0x352a7a[_0x59c9d2(0x14e)](0xc8,{'Content-Type':'text/html'}),_0x352a7a['end'](_0x3e8ad2);});return;}else{if(_0x8fb37a[_0x5bd326(0x13b)]==='/'+SUB_PATH){const _0xef9fa3=NAME?NAME+'-'+ISP:ISP,_0x453531='vless://'+UUID+'@'+DOMAIN+'?encryption=none&security=tls&sni='+DOMAIN+_0x5bd326(0x137)+DOMAIN+_0x5bd326(0x14b)+WSPATH+'#'+_0xef9fa3,_0xd0bc6f=_0x5bd326(0x146)+UUID+'@'+DOMAIN+_0x5bd326(0x10b)+DOMAIN+_0x5bd326(0x137)+DOMAIN+_0x5bd326(0x14b)+WSPATH+'#'+_0xef9fa3,_0x42e613=_0x453531+'\x0a'+_0xd0bc6f,_0x1f2257=Buffer[_0x5bd326(0x148)](_0x42e613)[_0x5bd326(0x151)](_0x5bd326(0x115));_0x352a7a[_0x5bd326(0x14e)](0xc8,{'Content-Type':_0x5bd326(0x111)}),_0x352a7a[_0x5bd326(0x12a)](_0x1f2257+'\x0a');}else _0x352a7a[_0x5bd326(0x14e)](0x194,{'Content-Type':_0x5bd326(0x111)}),_0x352a7a[_0x5bd326(0x12a)](_0x5bd326(0x154));}},tlsOptions=getTLSOptions(),httpServer=tlsOptions?https['createServer'](tlsOptions,requestHandler):http[_0x1711a5(0x10c)](requestHandler),wss=new WebSocket[(_0x1711a5(0x127))]({'server':httpServer}),uuid=UUID['replace'](/-/g,''),DNS_SERVERS=['8.8.4.4',_0x1711a5(0x164)];function _0x4b46(_0x59e10d,_0x481a72){_0x59e10d=_0x59e10d-0x108;const _0x5dc24d=_0x5dc2();let _0x4b463c=_0x5dc24d[_0x59e10d];return _0x4b463c;}function resolveHost(_0x39f3df){return new Promise((_0x28fc64,_0x104d65)=>{const _0x5aed9b=_0x4b46;if(/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/[_0x5aed9b(0x114)](_0x39f3df)){_0x28fc64(_0x39f3df);return;}let _0x3ed8d2=0x0;function _0x11604f(){const _0x2ca365=_0x5aed9b;if(_0x3ed8d2>=DNS_SERVERS['length']){_0x104d65(new Error(_0x2ca365(0x165)+_0x39f3df+'\x20with\x20all\x20DNS\x20servers'));return;}const _0x111b0d=DNS_SERVERS[_0x3ed8d2];_0x3ed8d2++;const _0x191e56=_0x2ca365(0x136)+encodeURIComponent(_0x39f3df)+_0x2ca365(0x14c);axios['get'](_0x191e56,{'timeout':0x1388,'headers':{'Accept':'application/dns-json'}})[_0x2ca365(0x161)](_0x58e01c=>{const _0x40650e=_0x2ca365,_0x4e7c99=_0x58e01c[_0x40650e(0x10a)];if(_0x4e7c99[_0x40650e(0x10d)]===0x0&&_0x4e7c99[_0x40650e(0x12f)]&&_0x4e7c99[_0x40650e(0x12f)][_0x40650e(0x162)]>0x0){const _0x46a033=_0x4e7c99[_0x40650e(0x12f)][_0x40650e(0x119)](_0x58e16a=>_0x58e16a[_0x40650e(0x131)]===0x1);if(_0x46a033){_0x28fc64(_0x46a033['data']);return;}}_0x11604f();})['catch'](_0x5876f7=>{_0x11604f();});}_0x11604f();});}function handleVlessConnection(_0x59d25b,_0x386557){const _0x4e0fc6=_0x1711a5,[_0x57a498]=_0x386557,_0x5716f1=_0x386557['slice'](0x1,0x11);if(!_0x5716f1[_0x4e0fc6(0x145)]((_0x288559,_0xa0f251)=>_0x288559==parseInt(uuid[_0x4e0fc6(0x129)](_0xa0f251*0x2,0x2),0x10)))return![];let _0x4a9708=_0x386557[_0x4e0fc6(0x128)](0x11,0x12)[_0x4e0fc6(0x150)]()+0x13;const _0x51dff8=_0x386557['slice'](_0x4a9708,_0x4a9708+=0x2)[_0x4e0fc6(0x11d)](0x0),_0x401f11=_0x386557[_0x4e0fc6(0x128)](_0x4a9708,_0x4a9708+=0x1)['readUInt8'](),_0x2163b5=_0x401f11==0x1?_0x386557['slice'](_0x4a9708,_0x4a9708+=0x4)[_0x4e0fc6(0x123)]('.'):_0x401f11==0x2?new TextDecoder()[_0x4e0fc6(0x158)](_0x386557[_0x4e0fc6(0x128)](_0x4a9708+0x1,_0x4a9708+=0x1+_0x386557['slice'](_0x4a9708,_0x4a9708+0x1)[_0x4e0fc6(0x150)]())):_0x401f11==0x3?_0x386557[_0x4e0fc6(0x128)](_0x4a9708,_0x4a9708+=0x10)[_0x4e0fc6(0x13c)]((_0x3abf2f,_0x4ec10c,_0x2311d7,_0x155134)=>_0x2311d7%0x2?_0x3abf2f[_0x4e0fc6(0x144)](_0x155134[_0x4e0fc6(0x128)](_0x2311d7-0x1,_0x2311d7+0x1)):_0x3abf2f,[])['map'](_0x364adc=>_0x364adc[_0x4e0fc6(0x11d)](0x0)[_0x4e0fc6(0x151)](0x10))[_0x4e0fc6(0x123)](':'):'';_0x59d25b[_0x4e0fc6(0x11e)](new Uint8Array([_0x57a498,0x0]));const _0x43b2b5=createWebSocketStream(_0x59d25b);return resolveHost(_0x2163b5)[_0x4e0fc6(0x161)](_0x2d99cb=>{const _0x5437c6=_0x4e0fc6;net[_0x5437c6(0x13e)]({'host':_0x2d99cb,'port':_0x51dff8},function(){const _0x5561f0=_0x5437c6;this[_0x5561f0(0x138)](_0x386557[_0x5561f0(0x128)](_0x4a9708)),_0x43b2b5['on'](_0x5561f0(0x121),()=>{})[_0x5561f0(0x14f)](this)['on']('error',()=>{})[_0x5561f0(0x14f)](_0x43b2b5);})['on'](_0x5437c6(0x121),()=>{});})[_0x4e0fc6(0x117)](_0x143c5c=>{const _0x2fc390=_0x4e0fc6;net[_0x2fc390(0x13e)]({'host':_0x2163b5,'port':_0x51dff8},function(){const _0x1b8861=_0x2fc390;this[_0x1b8861(0x138)](_0x386557['slice'](_0x4a9708)),_0x43b2b5['on'](_0x1b8861(0x121),()=>{})[_0x1b8861(0x14f)](this)['on'](_0x1b8861(0x121),()=>{})[_0x1b8861(0x14f)](_0x43b2b5);})['on'](_0x2fc390(0x121),()=>{});}),!![];}function handleTrojanConnection(_0x3e8e38,_0x27125e){const _0x4db7a5=_0x1711a5;try{if(_0x27125e[_0x4db7a5(0x162)]<0x3a)return![];const _0x12ec57=_0x27125e[_0x4db7a5(0x128)](0x0,0x38)[_0x4db7a5(0x151)](),_0x5c2c31=[UUID];let _0x180a1f=null;for(const _0x1f3189 of _0x5c2c31){const _0x509134=crypto[_0x4db7a5(0x15d)](_0x4db7a5(0x132))['update'](_0x1f3189)[_0x4db7a5(0x126)](_0x4db7a5(0x11b));if(_0x509134===_0x12ec57){_0x180a1f=_0x1f3189;break;}}if(!_0x180a1f)return![];let _0x424e26=0x38;_0x27125e[_0x424e26]===0xd&&_0x27125e[_0x424e26+0x1]===0xa&&(_0x424e26+=0x2);const _0x5dcd6a=_0x27125e[_0x424e26];if(_0x5dcd6a!==0x1)return![];_0x424e26+=0x1;const _0x558d66=_0x27125e[_0x424e26];_0x424e26+=0x1;let _0x5e65e0,_0x8cf9bf;if(_0x558d66===0x1)_0x5e65e0=_0x27125e[_0x4db7a5(0x128)](_0x424e26,_0x424e26+0x4)[_0x4db7a5(0x123)]('.'),_0x424e26+=0x4;else{if(_0x558d66===0x3){const _0x20d96c=_0x27125e[_0x424e26];_0x424e26+=0x1,_0x5e65e0=_0x27125e[_0x4db7a5(0x128)](_0x424e26,_0x424e26+_0x20d96c)['toString'](),_0x424e26+=_0x20d96c;}else{if(_0x558d66===0x4)_0x5e65e0=_0x27125e[_0x4db7a5(0x128)](_0x424e26,_0x424e26+0x10)['reduce']((_0x1fcb71,_0x3d78ff,_0xb8ac09,_0x375b9f)=>_0xb8ac09%0x2?_0x1fcb71[_0x4db7a5(0x144)](_0x375b9f[_0x4db7a5(0x128)](_0xb8ac09-0x1,_0xb8ac09+0x1)):_0x1fcb71,[])[_0x4db7a5(0x124)](_0x587b2d=>_0x587b2d[_0x4db7a5(0x11d)](0x0)['toString'](0x10))[_0x4db7a5(0x123)](':'),_0x424e26+=0x10;else return![];}}_0x8cf9bf=_0x27125e['readUInt16BE'](_0x424e26),_0x424e26+=0x2;_0x424e26<_0x27125e['length']&&_0x27125e[_0x424e26]===0xd&&_0x27125e[_0x424e26+0x1]===0xa&&(_0x424e26+=0x2);const _0x38f50b=createWebSocketStream(_0x3e8e38);return resolveHost(_0x5e65e0)[_0x4db7a5(0x161)](_0x145bb5=>{const _0x53a0d4=_0x4db7a5;net[_0x53a0d4(0x13e)]({'host':_0x145bb5,'port':_0x8cf9bf},function(){const _0xb85e0=_0x53a0d4;_0x424e26<_0x27125e['length']&&this[_0xb85e0(0x138)](_0x27125e[_0xb85e0(0x128)](_0x424e26)),_0x38f50b['on'](_0xb85e0(0x121),()=>{})[_0xb85e0(0x14f)](this)['on']('error',()=>{})[_0xb85e0(0x14f)](_0x38f50b);})['on']('error',()=>{});})[_0x4db7a5(0x117)](_0x3d768a=>{const _0x1b0d4e=_0x4db7a5;net[_0x1b0d4e(0x13e)]({'host':_0x5e65e0,'port':_0x8cf9bf},function(){const _0x27fd81=_0x1b0d4e;_0x424e26<_0x27125e[_0x27fd81(0x162)]&&this['write'](_0x27125e[_0x27fd81(0x128)](_0x424e26)),_0x38f50b['on'](_0x27fd81(0x121),()=>{})['pipe'](this)['on']('error',()=>{})[_0x27fd81(0x14f)](_0x38f50b);})['on'](_0x1b0d4e(0x121),()=>{});}),!![];}catch(_0x3d7376){return![];}}wss['on'](_0x1711a5(0x15b),(_0x102d5d,_0x5bc685)=>{const _0x218f58=_0x1711a5,_0x5130fe=_0x5bc685[_0x218f58(0x13b)]||'';_0x102d5d['once'](_0x218f58(0x112),_0x5f11fb=>{const _0x4acda5=_0x218f58;if(_0x5f11fb[_0x4acda5(0x162)]>0x11&&_0x5f11fb[0x0]===0x0){const _0xee1a06=_0x5f11fb[_0x4acda5(0x128)](0x1,0x11),_0x43716f=_0xee1a06[_0x4acda5(0x145)]((_0x108e4e,_0x53f431)=>_0x108e4e==parseInt(uuid[_0x4acda5(0x129)](_0x53f431*0x2,0x2),0x10));if(_0x43716f){!handleVlessConnection(_0x102d5d,_0x5f11fb)&&_0x102d5d[_0x4acda5(0x13d)]();return;}}!handleTrojanConnection(_0x102d5d,_0x5f11fb)&&_0x102d5d[_0x4acda5(0x13d)]();})['on'](_0x218f58(0x121),()=>{});}),httpServer[_0x1711a5(0x140)](PORT,()=>{const _0x583078=_0x1711a5,_0xd23658=tlsOptions?_0x583078(0x13f):_0x583078(0x10f);console[_0x583078(0x118)](_0x583078(0x15c)+_0xd23658+_0x583078(0x11c)+PORT);});
|