@kontikijs/socket
Version:
A server socket and client for Kontiki JS.
53 lines (40 loc) • 11.3 kB
JavaScript
/** The MIT License (MIT)
Copyright (c) 2021-present, Daniel K. Hendricks
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. */
import _0x592f85 from 'fs';
import _0x4e312f from 'path';
import { Server } from 'socket.io';
const _0x1586=['1bsREfD','1069PmXUvP','svelte','149537OpGbBq','2783QkhrkC','1cwXmeQ','resolve','1koWhfu','dependencies','includes','parse','135583xNrfSq','assign','toString','keys','react','579499CdstFQ','vue','readFileSync','283fulQcK','542040enkBnr','1151aaZwdI','431285chbIRL','length'];function _0x2b8a(_0x2b0afa,_0x43a52b){return _0x2b8a=function(_0x158698,_0x2b8ab6){_0x158698=_0x158698-0x1f1;let _0x1b7d3a=_0x1586[_0x158698];return _0x1b7d3a;},_0x2b8a(_0x2b0afa,_0x43a52b);}const _0x42bae6=_0x2b8a;(function(_0x3e6c67,_0x2078df){const _0x514645=_0x2b8a;while(!![]){try{const _0x367dbf=-parseInt(_0x514645(0x1fe))+-parseInt(_0x514645(0x200))+parseInt(_0x514645(0x1ff))*parseInt(_0x514645(0x203))+-parseInt(_0x514645(0x1fa))*parseInt(_0x514645(0x207))+parseInt(_0x514645(0x1f5))*parseInt(_0x514645(0x1f1))+parseInt(_0x514645(0x1fd))*parseInt(_0x514645(0x206))+-parseInt(_0x514645(0x205))*-parseInt(_0x514645(0x202));if(_0x367dbf===_0x2078df)break;else _0x3e6c67['push'](_0x3e6c67['shift']());}catch(_0xa0c9b){_0x3e6c67['push'](_0x3e6c67['shift']());}}}(_0x1586,0xb72e0));const pkg=JSON[_0x42bae6(0x1f4)](_0x592f85[_0x42bae6(0x1fc)](_0x4e312f[_0x42bae6(0x208)](process['cwd']()+'/package.json'),'utf-8')[_0x42bae6(0x1f7)]()),framework={};var _0x2cf374 = ()=>{const _0x895860=_0x42bae6,_0x3f09cb=[_0x895860(0x1fb),_0x895860(0x1f9),_0x895860(0x204)];let _0x5827d2=0x0,_0x521a20=0x0;const _0x1dd49a=Object[_0x895860(0x1f8)](pkg[_0x895860(0x1f2)]);while(_0x5827d2<_0x3f09cb[_0x895860(0x201)]){while(_0x521a20<_0x1dd49a[_0x895860(0x201)]){_0x3f09cb[_0x895860(0x1f3)](_0x1dd49a[_0x521a20])&&(Object[_0x895860(0x1f6)](framework,{'name':_0x1dd49a[_0x521a20]}),Object[_0x895860(0x1f6)](framework,{'version':pkg['dependencies'][_0x1dd49a[_0x521a20]]})),_0x521a20++;}_0x5827d2++;}return framework;};
const _0x3a42=['83RNRYxc','219353kOmNHj','529DJkVQK','5eVFOlO','302jBgbTl','1089349KziEJn','939707UlQYWC','1406961GRRsJu','10547EQZngw','78tgWmsR','4965htEdUT'];(function(_0x1b9620,_0x563880){const _0x95fb6b=_0x5e24;while(!![]){try{const _0x4d4885=parseInt(_0x95fb6b(0x84))+-parseInt(_0x95fb6b(0x82))+-parseInt(_0x95fb6b(0x7f))*parseInt(_0x95fb6b(0x81))+parseInt(_0x95fb6b(0x7d))*-parseInt(_0x95fb6b(0x7a))+parseInt(_0x95fb6b(0x7b))*-parseInt(_0x95fb6b(0x7c))+parseInt(_0x95fb6b(0x83))+parseInt(_0x95fb6b(0x80))*parseInt(_0x95fb6b(0x7e));if(_0x4d4885===_0x563880)break;else _0x1b9620['push'](_0x1b9620['shift']());}catch(_0x3a0b94){_0x1b9620['push'](_0x1b9620['shift']());}}}(_0x3a42,0xe3747));function _0x5e24(_0xc4d015,_0x21580a){return _0x5e24=function(_0x3a4275,_0x5e248b){_0x3a4275=_0x3a4275-0x7a;let _0x507fe4=_0x3a42[_0x3a4275];return _0x507fe4;},_0x5e24(_0xc4d015,_0x21580a);}var _0x5ed6f3 = (_0x16d6eb,_0x5bec3b,_0x39702a)=>{const _0x5a80e8=new Server(_0x16d6eb,_0x5bec3b);if(_0x39702a)_0x39702a(_0x5a80e8);};
const _0xd0e0=['2ZxZKNQ','453163dVrdmI','httpServer','53SPbgWs','452022tuvgiT','1FptAAF','2129bpcugd','174333umDYRr','264729SmroaZ','103029vxIRRO','3vgMLtc','189509LWMJLp','script'];(function(_0xb0df6b,_0x2416a8){const _0xd04a18=_0x3508;while(!![]){try{const _0xb14095=-parseInt(_0xd04a18(0xd5))*parseInt(_0xd04a18(0xd4))+parseInt(_0xd04a18(0xcf))+-parseInt(_0xd04a18(0xd3))+-parseInt(_0xd04a18(0xcb))*parseInt(_0xd04a18(0xc9))+parseInt(_0xd04a18(0xce))*parseInt(_0xd04a18(0xd1))+parseInt(_0xd04a18(0xcc))*parseInt(_0xd04a18(0xd0))+parseInt(_0xd04a18(0xd2));if(_0xb14095===_0x2416a8)break;else _0xb0df6b['push'](_0xb0df6b['shift']());}catch(_0x15ac10){_0xb0df6b['push'](_0xb0df6b['shift']());}}}(_0xd0e0,0x3a7a1));function _0x3508(_0x83c502,_0x2fdf17){return _0x3508=function(_0xd0e09b,_0x350836){_0xd0e09b=_0xd0e09b-0xc9;let _0x195c15=_0xd0e0[_0xd0e09b];return _0x195c15;},_0x3508(_0x83c502,_0x2fdf17);}var _0x4986bb = (_0x36003e,_0xea4763)=>{const _0x30f606=_0x3508;if(_0xea4763){const _0x5dc055=_0xea4763['middleware'],_0x24fedf=_0xea4763['options'],_0x37a868=_0xea4763[_0x30f606(0xca)]||{},_0x206b73=_0x5dc055?_0x24fedf:_0x36003e[_0x30f606(0xcd)];_0xea4763?_0x5ed6f3(_0x206b73,_0x24fedf,_0x37a868):{};}};
const _0x4aa6=['1zFoYJH','<script\x20src=\x22https://cdn.socket.io/4.1.2/socket.io.min.js\x22></script>','907111QEfaaN','1ZYbBOG','replace','<head>\x20\x0a\x20','97999SqBeRT','201735cPYRFr','269975pPFaEm','92hoGjGz','16708DyOifo','<head>','1738846uoETCV','1669838ixYMuV'];function _0x372f(_0x495ef9,_0x595f83){return _0x372f=function(_0x4aa6e2,_0x372f6a){_0x4aa6e2=_0x4aa6e2-0xf2;let _0x3be4fe=_0x4aa6[_0x4aa6e2];return _0x3be4fe;},_0x372f(_0x495ef9,_0x595f83);}(function(_0x4fba94,_0x4a7d32){const _0x565857=_0x372f;while(!![]){try{const _0x96f370=-parseInt(_0x565857(0xfe))*parseInt(_0x565857(0xfc))+-parseInt(_0x565857(0xf4))+parseInt(_0x565857(0xf5))+parseInt(_0x565857(0xf6))+-parseInt(_0x565857(0xf8))*-parseInt(_0x565857(0xf7))+parseInt(_0x565857(0xff))*parseInt(_0x565857(0xfb))+-parseInt(_0x565857(0xfa));if(_0x96f370===_0x4a7d32)break;else _0x4fba94['push'](_0x4fba94['shift']());}catch(_0x4db51c){_0x4fba94['push'](_0x4fba94['shift']());}}}(_0x4aa6,0xe4348));var _0x5577ba = _0x518753=>{const _0x14f836=_0x372f,_0x103c90=_0x14f836(0xfd);return _0x518753[_0x14f836(0xf2)](_0x14f836(0xf9),_0x14f836(0xf3)+_0x103c90);};
const _0x5913=['length','push','11TjGvHQ','5LhUwib','mixin','960437HbWQwI','485140kRGYnG','config','$io','install','3654EHVbfH','assign','1437993wtcqnN','258337pJjNJH','121nBZdBv','socket','globalProperties','958760bAndus','115337CwhQfP'];const _0x47a01f=_0x503d;(function(_0x1e49df,_0xc1533a){const _0x587242=_0x503d;while(!![]){try{const _0x1fe8bd=-parseInt(_0x587242(0xeb))*parseInt(_0x587242(0xf5))+parseInt(_0x587242(0xea))*-parseInt(_0x587242(0xe7))+parseInt(_0x587242(0xe6))+parseInt(_0x587242(0xf6))*-parseInt(_0x587242(0xf2))+parseInt(_0x587242(0xee))+parseInt(_0x587242(0xed))+parseInt(_0x587242(0xf4));if(_0x1fe8bd===_0xc1533a)break;else _0x1e49df['push'](_0x1e49df['shift']());}catch(_0x41dcde){_0x1e49df['push'](_0x1e49df['shift']());}}}(_0x5913,0xcd07c));function _0x503d(_0x47292f,_0x34530d){return _0x503d=function(_0x59130b,_0x503de5){_0x59130b=_0x59130b-0xe5;let _0x1219b5=_0x5913[_0x59130b];return _0x1219b5;},_0x503d(_0x47292f,_0x34530d);}class Vue{[_0x47a01f(0xf1)](_0x5d0c2e,_0x1fead5){const _0x518063=_0x47a01f;_0x5d0c2e[_0x518063(0xec)]({'created'(){}});if(_0x1fead5&&_0x1fead5[_0x518063(0xf7)]){const _0xa482a4={},_0x969294=[];if(Array['isArray'](_0x1fead5[_0x518063(0xf7)])){let _0xb6c599=0x0;while(_0xb6c599<_0x1fead5[_0x518063(0xf7)][_0x518063(0xe8)]){const _0xfdc06f=_0x1fead5[_0x518063(0xf7)][_0xb6c599];_0x969294[_0x518063(0xe9)](this['io'](_0xfdc06f['options'])),_0xb6c599++;}}else Object[_0x518063(0xf3)](_0xa482a4,this['io'](_0x1fead5[_0x518063(0xf7)]['options']));_0x969294[_0x518063(0xe8)]>0x0?_0x5d0c2e[_0x518063(0xef)][_0x518063(0xe5)][_0x518063(0xf0)]=_0x969294:_0x5d0c2e[_0x518063(0xef)]['globalProperties'][_0x518063(0xf0)]=_0xa482a4;}(_0x1fead5===undefined||{}||null)&&(_0x5d0c2e['config']['globalProperties'][_0x518063(0xf0)]=this['io'](_0x1fead5));}}
const _0x4dc2=['2371TvhcoL','337711tLIYuG','length','1YyaLcR','replace','6isQWLa','1nrGZkP','name','5334iHckbE','3XJcytm','1cnyihP','vue','183281FEYIPL','145105HxhJdu','89MdrRzf','56187VxUkzJ','343770iccQej','install','1UBqOPz'];const _0x2b9581=_0x58f6;(function(_0x308e25,_0x486785){const _0x5768ec=_0x58f6;while(!![]){try{const _0x874358=parseInt(_0x5768ec(0x76))*-parseInt(_0x5768ec(0x78))+-parseInt(_0x5768ec(0x7c))*parseInt(_0x5768ec(0x6c))+-parseInt(_0x5768ec(0x70))*parseInt(_0x5768ec(0x7a))+-parseInt(_0x5768ec(0x71))*parseInt(_0x5768ec(0x6a))+-parseInt(_0x5768ec(0x6e))*-parseInt(_0x5768ec(0x73))+parseInt(_0x5768ec(0x77))*-parseInt(_0x5768ec(0x72))+-parseInt(_0x5768ec(0x6d))*-parseInt(_0x5768ec(0x74));if(_0x874358===_0x486785)break;else _0x308e25['push'](_0x308e25['shift']());}catch(_0x3b2a67){_0x308e25['push'](_0x308e25['shift']());}}}(_0x4dc2,0x2b8c9));const vue=new Vue();function _0x58f6(_0x41e592,_0x2c09ff){return _0x58f6=function(_0x4dc2d9,_0x58f600){_0x4dc2d9=_0x4dc2d9-0x6a;let _0x4d5403=_0x4dc2[_0x4dc2d9];return _0x4d5403;},_0x58f6(_0x41e592,_0x2c09ff);}const frameworks=[{'name':_0x2b9581(0x6f),'install':vue['install']['toString']()[_0x2b9581(0x7b)](/this./g,'')}];var _0x1889da = _0x3fbfed=>{const _0x166603=_0x2b9581;if(_0x3fbfed){let _0x499959=0x0;while(_0x499959<frameworks[_0x166603(0x79)]){if(frameworks[_0x499959][_0x166603(0x6b)]===_0x3fbfed[_0x166603(0x6b)])return frameworks[_0x499959][_0x166603(0x75)];++_0x499959;}}};
/**
* @title Kontiki JS / Socket
* @description Sockets for Kontiki JS.
*
* @author Daniel K. Hendricks
* @license MIT (Please read the attached license in root)
* @copyright (c) 2021-present, Daniel K. Hendricks
*
* @see https://kontikijs.org
* @support https://kontikijs.com
*/
const _0x4596=['1139707GpBRGh','1364220VwGczW','745216UicZCJ','1212941Sseieh','37583dHbFKO','34YYVfEl','1416817rPdLNl','19247PWtJZu','export\x20default\x20{','kontiki:socket'];(function(_0x48aa4d,_0x394585){const _0x3bb2b6=_0x51a9;while(!![]){try{const _0x3b4b36=-parseInt(_0x3bb2b6(0x150))+parseInt(_0x3bb2b6(0x154))+parseInt(_0x3bb2b6(0x151))+parseInt(_0x3bb2b6(0x153))*-parseInt(_0x3bb2b6(0x152))+-parseInt(_0x3bb2b6(0x14b))+-parseInt(_0x3bb2b6(0x14e))+parseInt(_0x3bb2b6(0x14f));if(_0x3b4b36===_0x394585)break;else _0x48aa4d['push'](_0x48aa4d['shift']());}catch(_0x279e7a){_0x48aa4d['push'](_0x48aa4d['shift']());}}}(_0x4596,0xc63d2));function _0x51a9(_0x1dfd05,_0x44981c){return _0x51a9=function(_0x4596c2,_0x51a942){_0x4596c2=_0x4596c2-0x14b;let _0x54c163=_0x4596[_0x4596c2];return _0x54c163;},_0x51a9(_0x1dfd05,_0x44981c);}const virtualFileId='@io',clientPlugin=_0x1889da(_0x2cf374());const socket=_0x58ea75=>{const _0x31c9a3=_0x51a9;return {'name':_0x31c9a3(0x14d),'configureServer'(_0x5395a4){return _0x4986bb(_0x5395a4,_0x58ea75);},'transformIndexHtml'(_0x376a48){return _0x5577ba(_0x376a48);},'resolveId'(_0x3a7a1d){if(_0x3a7a1d===virtualFileId)return virtualFileId;},'load'(_0x1af7c0){const _0x2542bc=_0x31c9a3;if(_0x1af7c0===virtualFileId)return _0x2542bc(0x14c)+clientPlugin+'}';}};};
export { socket };
//# sourceMappingURL=index.esm.js.map