forked from eli32-vlc/scrper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
1 lines (1 loc) · 9.27 KB
/
index.js
1
const _0x552fa9=_0x352d;(function(_0x31d307,_0xb3828d){const _0x2fe913=_0x352d,_0x276449=_0x31d307();while(!![]){try{const _0x357256=-parseInt(_0x2fe913(0x1c5))/0x1*(-parseInt(_0x2fe913(0x1e1))/0x2)+parseInt(_0x2fe913(0x1cb))/0x3+parseInt(_0x2fe913(0x195))/0x4+parseInt(_0x2fe913(0x1c7))/0x5+-parseInt(_0x2fe913(0x1b6))/0x6*(-parseInt(_0x2fe913(0x1d3))/0x7)+-parseInt(_0x2fe913(0x1df))/0x8*(-parseInt(_0x2fe913(0x1a2))/0x9)+-parseInt(_0x2fe913(0x1dd))/0xa;if(_0x357256===_0xb3828d)break;else _0x276449['push'](_0x276449['shift']());}catch(_0x9da104){_0x276449['push'](_0x276449['shift']());}}}(_0xb2f9,0x9d239),require(_0x552fa9(0x1a9))[_0x552fa9(0x1b1)]());function _0x352d(_0x19af0d,_0x18dc54){const _0xb2f998=_0xb2f9();return _0x352d=function(_0x352dd3,_0xbcd5c){_0x352dd3=_0x352dd3-0x195;let _0x2a1203=_0xb2f998[_0x352dd3];return _0x2a1203;},_0x352d(_0x19af0d,_0x18dc54);}const net=require('net'),{TextDecoder}=require(_0x552fa9(0x1ca)),{WebSocket,createWebSocketStream}=require('ws'),axios=require(_0x552fa9(0x199)),ThrottleGroup=require(_0x552fa9(0x1c6))[_0x552fa9(0x1d4)],NodeCache=require('node-cache'),{PORT=0x1f90,UUID_LIST_URL,SPEED_LIMIT_MBPS=0x5,REFRESH_UUID_INTERVAL=0x493e0,DISCORD_WEBHOOK_URL}=process[_0x552fa9(0x1cd)],BYTE_TO_MBPS=0x400*0x400/0x8,SPEED_LIMIT_BYTES=SPEED_LIMIT_MBPS*BYTE_TO_MBPS;let stats={'activeConnections':0x0,'totalTrafficBytes':0x0,'lastTrafficBytes':0x0,'lastUpdate':Date[_0x552fa9(0x1ae)]()};const uuidCache=new NodeCache({'stdTTL':0x258}),uploadThrottle=new ThrottleGroup({'rate':SPEED_LIMIT_BYTES}),downloadThrottle=new ThrottleGroup({'rate':SPEED_LIMIT_BYTES});async function sendStatsToDiscord(){const _0x1dbadb=_0x552fa9;if(!DISCORD_WEBHOOK_URL)return;const _0x264b68=Date[_0x1dbadb(0x1ae)](),_0x3aa892=(_0x264b68-stats[_0x1dbadb(0x1be)])/0x3e8,_0x455bcf=stats[_0x1dbadb(0x1ad)]-stats['lastTrafficBytes'],_0x1663ce=(_0x455bcf*0x8/_0x3aa892/(0x400*0x400))[_0x1dbadb(0x1da)](0x2),_0x2a609e={'embeds':[{'title':_0x1dbadb(0x1cc),'color':0x3498db,'fields':[{'name':_0x1dbadb(0x19c),'value':stats['activeConnections'][_0x1dbadb(0x1db)](),'inline':!![]},{'name':_0x1dbadb(0x1b2),'value':(stats['totalTrafficBytes']/(0x400*0x400*0x400))[_0x1dbadb(0x1da)](0x2)+_0x1dbadb(0x1b5),'inline':!![]},{'name':_0x1dbadb(0x1b9),'value':_0x1663ce+'\x20Mbps','inline':!![]}],'timestamp':new Date()['toISOString']()}]};try{await axios[_0x1dbadb(0x19f)](DISCORD_WEBHOOK_URL,_0x2a609e),stats[_0x1dbadb(0x1d5)]=stats[_0x1dbadb(0x1ad)],stats[_0x1dbadb(0x1be)]=_0x264b68;}catch(_0xa8447){console[_0x1dbadb(0x1c4)]('Failed\x20to\x20send\x20Discord\x20webhook:',_0xa8447[_0x1dbadb(0x1d0)]);}}const log=(_0x483226,..._0x5713a1)=>{const _0x207369=_0x552fa9,_0x3b0101=new Date()[_0x207369(0x1d1)](),_0x21383f=_0x5713a1[_0x207369(0x1ce)]('\x20');console[_0x483226]('['+_0x3b0101+']\x20'+_0x483226[_0x207369(0x1c9)]()+':\x20'+_0x21383f);};setInterval(sendStatsToDiscord,0x493e0);function normalizeUUID(_0x1707fd){const _0x38de18=_0x552fa9;return _0x1707fd[_0x38de18(0x19d)](/-/g,'')['toLowerCase']();}async function refreshUUIDList(){const _0x1bb1fc=_0x552fa9;try{const _0x21b0aa=await axios[_0x1bb1fc(0x1c8)](UUID_LIST_URL),_0x54f8a8=_0x21b0aa[_0x1bb1fc(0x1d7)][_0x1bb1fc(0x1d8)]()[_0x1bb1fc(0x1c1)]('\x0a')[_0x1bb1fc(0x19a)](_0x3810d2=>normalizeUUID(_0x3810d2['trim']()));uuidCache['set'](_0x1bb1fc(0x1bc),_0x54f8a8),log(_0x1bb1fc(0x19e),_0x1bb1fc(0x1ab)+_0x54f8a8['length']+_0x1bb1fc(0x1bf));}catch(_0x337408){log('error',_0x1bb1fc(0x1ba),_0x337408[_0x1bb1fc(0x1d0)]);}}refreshUUIDList(),setInterval(refreshUUIDList,REFRESH_UUID_INTERVAL);function isUUIDAuthorized(_0x38c1b0){const _0x441225=_0x552fa9,_0x2e0cfd=uuidCache[_0x441225(0x1c8)](_0x441225(0x1bc))||[],_0x54926c=normalizeUUID(_0x38c1b0);return _0x2e0cfd['includes'](_0x54926c);}const wss=new WebSocket[(_0x552fa9(0x1e2))]({'port':PORT},()=>{const _0x11a1ea=_0x552fa9;log('info',_0x11a1ea(0x1bb)+PORT),log(_0x11a1ea(0x19e),_0x11a1ea(0x1dc)+SPEED_LIMIT_MBPS+'\x20Mbps');});function _0xb2f9(){const _0x1b6b28=['4643460VPpPsQ','max','send','pipe','axios','map','\x20-\x20','Active\x20Connections','replace','info','post','Uncaught\x20Exception:','readUInt8','11054349gIQzbt','activeConnections','WebSocket\x20error\x20from\x20','WebSocket\x20stream\x20error:\x20','readUInt16BE','Authentication\x20failed\x20for\x20IP:\x20','throttle','dotenv','slice','UUID\x20list\x20refreshed\x20successfully.\x20','\x20→\x20','totalTrafficBytes','now','hex','New\x20connection\x20from\x20','config','Total\x20Traffic','Target\x20connection\x20established:\x20','close','\x20GB','934182TFaoac','Connection\x20established:\x20','write','Current\x20Bandwidth','Failed\x20to\x20fetch\x20UUID\x20list:','Server\x20started\x20on\x20port:\x20','authorized_uuids','socket','lastUpdate','\x20UUIDs\x20loaded','\x20with\x20UUID:\x20','split','reduce','destroy','error','86xwoFYX','stream-throttle','218205XoMeGj','get','toUpperCase','util','3666921WqUgOz','VLESS\x20Server\x20Stats','env','join','Connection\x20closed\x20for\x20IP:\x20','message','toISOString','once','42tkoLfl','ThrottleGroup','lastTrafficBytes','Unhandled\x20Rejection\x20at:','data','trim','uncaughtException','toFixed','toString','Speed\x20limit\x20set\x20to:\x20','48097430wGRutH','length','8OoewNY','remoteAddress','20096SbrORs','Server','Message\x20handling\x20error\x20from\x20'];_0xb2f9=function(){return _0x1b6b28;};return _0xb2f9();}wss['on']('connection',(_0x2adfa4,_0x28c8b6)=>{const _0x20ff6d=_0x552fa9,_0x4b1cc6=_0x28c8b6[_0x20ff6d(0x1bd)][_0x20ff6d(0x1e0)];stats[_0x20ff6d(0x1a3)]++,log(_0x20ff6d(0x19e),_0x20ff6d(0x1b0)+_0x4b1cc6+'\x20(Active:\x20'+stats[_0x20ff6d(0x1a3)]+')'),_0x2adfa4[_0x20ff6d(0x1d2)](_0x20ff6d(0x1d0),_0x5d273f=>handleMessage(_0x5d273f,_0x2adfa4,_0x4b1cc6)),_0x2adfa4['on'](_0x20ff6d(0x1b4),()=>{const _0x39a77d=_0x20ff6d;stats[_0x39a77d(0x1a3)]=Math['max'](0x0,stats[_0x39a77d(0x1a3)]-0x1),log(_0x39a77d(0x19e),_0x39a77d(0x1cf)+_0x4b1cc6+',\x20Active\x20connections:\x20'+stats['activeConnections']);}),_0x2adfa4['on'](_0x20ff6d(0x1c4),_0x406b74=>{const _0x18e174=_0x20ff6d;log('error',_0x18e174(0x1a4)+_0x4b1cc6+':',_0x406b74[_0x18e174(0x1d0)]),stats['activeConnections']=Math[_0x18e174(0x196)](0x0,stats[_0x18e174(0x1a3)]-0x1);});});const handleMessage=(_0x46f0dd,_0x4555b1,_0x957439)=>{const _0x1d447d=_0x552fa9;try{const _0x4de03f=_0x46f0dd[_0x1d447d(0x1aa)](0x1,0x11)['toString'](_0x1d447d(0x1af));if(!isUUIDAuthorized(_0x4de03f)){log(_0x1d447d(0x1c4),_0x1d447d(0x1a7)+_0x957439+_0x1d447d(0x1c0)+_0x4de03f),_0x4555b1[_0x1d447d(0x1b4)]();return;}const [_0x30b7b4]=_0x46f0dd;let _0x16282d=_0x46f0dd[_0x1d447d(0x1aa)](0x11,0x12)[_0x1d447d(0x1a1)]()+0x13;const _0x577d8c=_0x46f0dd['slice'](_0x16282d,_0x16282d+=0x2)[_0x1d447d(0x1a6)](0x0),_0x51735d=_0x46f0dd[_0x1d447d(0x1aa)](_0x16282d,_0x16282d+=0x1)[_0x1d447d(0x1a1)](),_0x53647b={0x1:()=>_0x46f0dd[_0x1d447d(0x1aa)](_0x16282d,_0x16282d+=0x4)['join']('.'),0x2:()=>new TextDecoder()['decode'](_0x46f0dd[_0x1d447d(0x1aa)](_0x16282d+0x1,_0x16282d+=0x1+_0x46f0dd[_0x1d447d(0x1aa)](_0x16282d,_0x16282d+0x1)[_0x1d447d(0x1a1)]())),0x3:()=>_0x46f0dd['slice'](_0x16282d,_0x16282d+=0x10)[_0x1d447d(0x1c2)]((_0x2c279e,_0x4e1b0f,_0x417de4,_0x1119d5)=>_0x417de4%0x2?_0x2c279e['concat'](_0x1119d5[_0x1d447d(0x1aa)](_0x417de4-0x1,_0x417de4+0x1)):_0x2c279e,[])[_0x1d447d(0x19a)](_0x52e09c=>_0x52e09c[_0x1d447d(0x1a6)](0x0)[_0x1d447d(0x1db)](0x10))[_0x1d447d(0x1ce)](':')},_0x915c14=_0x53647b[_0x51735d]?_0x53647b[_0x51735d]():'';log(_0x1d447d(0x19e),_0x1d447d(0x1b7)+_0x957439+_0x1d447d(0x1ac)+_0x915c14+':'+_0x577d8c),_0x4555b1[_0x1d447d(0x197)](new Uint8Array([_0x30b7b4,0x0]));const _0x3a27e8=createWebSocketStream(_0x4555b1),_0x59fc7d=uploadThrottle[_0x1d447d(0x1a8)](),_0x22cb27=downloadThrottle[_0x1d447d(0x1a8)]();_0x59fc7d['on'](_0x1d447d(0x1d7),_0x1a43c3=>{const _0x4195d5=_0x1d447d;stats['totalTrafficBytes']+=_0x1a43c3[_0x4195d5(0x1de)];}),_0x22cb27['on'](_0x1d447d(0x1d7),_0x37327b=>{const _0x49d925=_0x1d447d;stats[_0x49d925(0x1ad)]+=_0x37327b[_0x49d925(0x1de)];}),establishConnection(_0x915c14,_0x577d8c,_0x46f0dd[_0x1d447d(0x1aa)](_0x16282d),_0x3a27e8,_0x59fc7d,_0x22cb27,_0x957439);}catch(_0x302bf2){log('error',_0x1d447d(0x1e3)+_0x957439+':',_0x302bf2[_0x1d447d(0x1d0)]),_0x4555b1[_0x1d447d(0x1b4)]();}},establishConnection=(_0x3939fe,_0x18c95a,_0x34a7e2,_0x58763a,_0x176c2e,_0x28f294,_0x5dcbdc)=>{const _0x486882=_0x552fa9,_0x59093a=net['connect']({'host':_0x3939fe,'port':_0x18c95a},function(){const _0x2362d7=_0x352d;log('info',_0x2362d7(0x1b3)+_0x5dcbdc+_0x2362d7(0x1ac)+_0x3939fe+':'+_0x18c95a),this[_0x2362d7(0x1b8)](_0x34a7e2),_0x58763a['on'](_0x2362d7(0x1c4),()=>{const _0x26dd13=_0x2362d7;log(_0x26dd13(0x1c4),_0x26dd13(0x1a5)+_0x5dcbdc+'\x20→\x20'+_0x3939fe+':'+_0x18c95a);})['pipe'](_0x176c2e)['pipe'](this)['on'](_0x2362d7(0x1c4),()=>{const _0x39fffe=_0x2362d7;log(_0x39fffe(0x1c4),'Socket\x20error:\x20'+_0x5dcbdc+_0x39fffe(0x1ac)+_0x3939fe+':'+_0x18c95a);})[_0x2362d7(0x198)](_0x28f294)[_0x2362d7(0x198)](_0x58763a);})['on'](_0x486882(0x1c4),_0x2d59a9=>{const _0xff7206=_0x486882;log('error','Connection\x20failed:\x20'+_0x5dcbdc+_0xff7206(0x1ac)+_0x3939fe+':'+_0x18c95a+_0xff7206(0x19b)+_0x2d59a9[_0xff7206(0x1d0)]),_0x58763a[_0xff7206(0x1c3)]();});};process['on'](_0x552fa9(0x1d9),_0x47c8f8=>{const _0x5c08e6=_0x552fa9;log('error',_0x5c08e6(0x1a0),_0x47c8f8['message']);}),process['on']('unhandledRejection',(_0x13a87c,_0x58708f)=>{const _0x2f876f=_0x552fa9;log(_0x2f876f(0x1c4),_0x2f876f(0x1d6),_0x13a87c);}),stats[_0x552fa9(0x1be)]=Date[_0x552fa9(0x1ae)]();