YiAi/YiAiQuickDeploy/dist/common/utils/getClientIp.js
2024-02-06 13:43:30 +08:00

1 line
2.4 KiB
JavaScript

'use strict';const _0xb919eb=_0x4458;(function(_0x292da6,_0x373ebc){const _0x3d15f1=_0x4458,_0x16d2c2=_0x292da6();while(!![]){try{const _0x1e2cf7=parseInt(_0x3d15f1(0xd2))/0x1*(-parseInt(_0x3d15f1(0xe9))/0x2)+parseInt(_0x3d15f1(0xe3))/0x3*(-parseInt(_0x3d15f1(0xdf))/0x4)+parseInt(_0x3d15f1(0xdc))/0x5*(-parseInt(_0x3d15f1(0xe2))/0x6)+parseInt(_0x3d15f1(0xd3))/0x7*(-parseInt(_0x3d15f1(0xce))/0x8)+parseInt(_0x3d15f1(0xe6))/0x9*(-parseInt(_0x3d15f1(0xeb))/0xa)+parseInt(_0x3d15f1(0xdb))/0xb+parseInt(_0x3d15f1(0xcf))/0xc*(parseInt(_0x3d15f1(0xd1))/0xd);if(_0x1e2cf7===_0x373ebc)break;else _0x16d2c2['push'](_0x16d2c2['shift']());}catch(_0x4be0a7){_0x16d2c2['push'](_0x16d2c2['shift']());}}}(_0x2ff7,0x7f762));Object[_0xb919eb(0xd0)](exports,_0xb919eb(0xdd),{'value':!![]}),exports[_0xb919eb(0xe7)]=void 0x0;function _0x2ff7(){const _0x249e52=['split','1282036haVlIL','includes','connection','210KXoUaV','6aQxUry','::ffff:','True-Client-IP','711WofJkl','getClientIp','X-Real-IP','1131928QFFbnD','pop','84470sisXtV','Proxy-Client-IP','3131104zDGdOP','12rCtEcf','defineProperty','36266087HbUhZm','1EXxaAW','7seHvez','X-Forwarded-For','trim','X-Client-IP','string','remoteAddress','HTTP_X_FORWARDED_FOR','test','5416081amzLAE','70615lZZJVr','__esModule'];_0x2ff7=function(){return _0x249e52;};return _0x2ff7();}function getClientIp(_0x473078){const _0x5db66c=_0xb919eb;let _0x5d56a4='';const _0x1049b3=[_0x5db66c(0xd6),_0x5db66c(0xe8),_0x5db66c(0xd4),'CF-Connecting-IP',_0x5db66c(0xe5),'X-Cluster-Client-IP',_0x5db66c(0xcd),'WL-Proxy-Client-IP','HTTP_CLIENT_IP',_0x5db66c(0xd9)];for(const _0x1799cc of _0x1049b3){const _0x1d26c3=_0x473078['headers'][_0x1799cc];if(_0x1d26c3&&typeof _0x1d26c3===_0x5db66c(0xd7)){const _0x53b99f=_0x1d26c3[_0x5db66c(0xde)](',');_0x5d56a4=_0x53b99f[0x0][_0x5db66c(0xd5)]();break;}}!_0x5d56a4&&(_0x5d56a4=_0x473078[_0x5db66c(0xe1)][_0x5db66c(0xd8)]||'');if(_0x5d56a4&&_0x5d56a4[_0x5db66c(0xe0)]('::')){const _0x5015b4=/^(::1|fe80(:1)?::1(%.*)?)$/i[_0x5db66c(0xda)](_0x5d56a4);if(_0x5015b4)_0x5d56a4='';else _0x5d56a4[_0x5db66c(0xe0)](_0x5db66c(0xe4))&&(_0x5d56a4=_0x5d56a4['split'](':')[_0x5db66c(0xea)]()||'');}return(!_0x5d56a4||!/\d+\.\d+\.\d+\.\d+/[_0x5db66c(0xda)](_0x5d56a4))&&(_0x5d56a4=''),_0x5d56a4;}function _0x4458(_0x56a76c,_0x4cbd91){const _0x2ff7d6=_0x2ff7();return _0x4458=function(_0x4458e3,_0x2ab031){_0x4458e3=_0x4458e3-0xcd;let _0x555eb4=_0x2ff7d6[_0x4458e3];return _0x555eb4;},_0x4458(_0x56a76c,_0x4cbd91);}exports[_0xb919eb(0xe7)]=getClientIp;