diff --git a/tun/ipstack.js b/tun/ipstack.js index bc44247..4ac592b 100644 --- a/tun/ipstack.js +++ b/tun/ipstack.js @@ -1,848 +1 @@ -"use strict"; -/*Compiled using Cheerp (R) by Leaning Technologies Ltd*/ -var __imul=Math.imul; -var __fround=Math.fround; -var oSlot=0;var nullArray=[null];var nullObj={d:nullArray,o:0}; -function fetchBuffer(p){ - return (typeof fetch==='function')? - fetch(p).then(r=>r.arrayBuffer()): - new Promise((y,n)=>{ - import('fs').then(r=>r.readFile(p,(e,d)=>{ - if(e)n(e); - else y(d); - })); - }); -} -function ___cxx_global_var_init$p2(){ - __ZN7IpStackL7chanMapE=_cheerpCreate_ZN6client4TMapIiPNS_14MessageChannelEEC2Ev(); -} -function ___cxx_global_var_init$p3(){ - __ZN7IpStackL11listenerMapE=_cheerpCreate_ZN6client4TMapIiPNS_13EventListenerEEC2Ev(); -} -function _cheerpCreate_ZN6client4TMapIiPNS_13EventListenerEEC2Ev(){ - return new Map(); -} -function _cheerpCreate_ZN6client4TMapIiPNS_14MessageChannelEEC2Ev(){ - return new Map(); -} -function __Z13createPromisev(Lagg$presult){ - var LretConstructor=null,LretConstructor7=null; - LretConstructor=_cheerpCreate_ZN6client9CheerpRefINS_13EventListenerEEC2Ev(); - LretConstructor7=_cheerpCreate_ZN6client9CheerpRefINS_13EventListenerEEC2Ev(); - Lagg$presult.a0=new Promise(function(__f,__r){LretConstructor.inner=__f;LretConstructor7.inner=__r;});; - Lagg$presult.a1=LretConstructor.inner; - Lagg$presult.a2=LretConstructor7.inner; -} -function _cheerpCreate_ZN6client9CheerpRefINS_13EventListenerEEC2Ev(){ - return new Object(); -} -function _sys_now(){ - return ~~ +performance.now()|0; -} -function __Z9output_jsPhi(Lbuf,Mbuf,Llen){ - var LretConstructor=null; - LretConstructor=new Uint8Array((+(Llen|0))); - LretConstructor.set(__ZN6cheerp14MakeTypedArrayIhN6client10Uint8ArrayEEEPT0_PKT_j(Lbuf,Mbuf,Llen)); - __ZL9output_cb(LretConstructor); -} -function __ZN6cheerp14MakeTypedArrayIhN6client10Uint8ArrayEEEPT0_PKT_j(Lptr,Mptr,Lsize){ - var tmp0=0,tmp1=null; - tmp0=Mptr; - tmp1=Lptr; - tmp1=tmp1; - if((Lsize|0)!==0){ - if((tmp0|0)===0)if( +tmp1.length===(+(Lsize>>>0)))return tmp1; - return tmp1.subarray((+(tmp0>>>0)),(+(tmp0+Lsize>>>0))); - } - if((tmp0|0)===0)return tmp1; - return tmp1.subarray((+(tmp0>>>0))); -} -function __Z14start_timeoutsv(){ - +setInterval(__ZN6cheerp8CallbackIZ14start_timeoutsvE3$_0EEPN6client13EventListenerEOT_(),10); -} -function __ZN6cheerp8CallbackIZ14start_timeoutsvE3$_0EEPN6client13EventListenerEOT_(){ - var Lref$ptmp=null,Lcall1=null; - Lref$ptmp={a0:null,a1:null,a2:null}; - __ZN6cheerp12make_closureIZ14start_timeoutsvE3$_0EEDTclsr13ClosureHelperIT_DTadsr3std16remove_referenceIS2_E4typeEonclEEE12make_closureclgssr6cheerpE7forwardIS2_Efp_EEEOS2_(Lref$ptmp); - Lcall1=__ZN6cheerp7ClosureIFvvEEcvPN6client13EventListenerEEv(Lref$ptmp); - __ZN6cheerp7ClosureIFvvEED2Ev(Lref$ptmp); - return Lcall1; -} -function __ZN6cheerp12make_closureIZ14start_timeoutsvE3$_0EEDTclsr13ClosureHelperIT_DTadsr3std16remove_referenceIS2_E4typeEonclEEE12make_closureclgssr6cheerpE7forwardIS2_Efp_EEEOS2_(Lagg$presult){ - __ZN6cheerp13ClosureHelperIZ14start_timeoutsvE3$_0MS1_KFvvEE12make_closureEOS1_(Lagg$presult); -} -function __ZN6cheerp7ClosureIFvvEEcvPN6client13EventListenerEEv(Lthis){ - var tmp0=null; - if(Lthis.a1!==null){ - tmp0=[{a0:null,a1:null}]; - tmp0[0].a0=Lthis.a1; - tmp0[0].a1=Lthis.a2; - tmp0=cheerpCreateClosure(__ZN6cheerp7ClosureIFvvEE14deleter_helperEPNS2_13DeleterHelperE,tmp0[0]); - __ZN6cheerp20EscapedResourcesListIN6client13EventListenerEE3addEPS2_PNS1_6ObjectE(Lthis.a0,tmp0); - Lthis.a1=null; - } - return Lthis.a0; -} -function __ZN6cheerp7ClosureIFvvEED2Ev(Lthis){ - var tmp0=null; - tmp0=Lthis.a1; - if(tmp0!==null)tmp0(Lthis.a2); -} -function __ZN6cheerp7ClosureIFvvEE14deleter_helperEPNS2_13DeleterHelperE(Lh){ - Lh.a0(Lh.a1); -} -function __ZN6cheerp20EscapedResourcesListIN6client13EventListenerEE3addEPS2_PNS1_6ObjectE(Lr,Ld){ - if(__ZN6cheerp20EscapedResourcesListIN6client13EventListenerEE9resourcesE===null)__ZN6cheerp20EscapedResourcesListIN6client13EventListenerEE9resourcesE=new Map(); - __ZN6cheerp20EscapedResourcesListIN6client13EventListenerEE9resourcesE.set(Lr,Ld); -} -function __ZN6cheerp13ClosureHelperIZ14start_timeoutsvE3$_0MS1_KFvvEE12make_closureEOS1_(Lagg$presult){ - __ZN6cheerp7ClosureIFvvEEC2IZ14start_timeoutsvE3$_0EET_PNSt9enable_ifIXsr3std14is_convertibleIS5_PS1_EE5valueEvE4typeE(Lagg$presult); -} -function __ZN6cheerp7ClosureIFvvEEC2IZ14start_timeoutsvE3$_0EET_PNSt9enable_ifIXsr3std14is_convertibleIS5_PS1_EE5valueEvE4typeE(Lthis){ - var tmp0=null; - tmp0=__ZZ14start_timeoutsvEN3$_08__invokeEv; - Lthis.a0=tmp0; - Lthis.a1=null; - Lthis.a2=null; -} -function __ZZ14start_timeoutsvEN3$_08__invokeEv(){ - __ZZ14start_timeoutsvENK3$_0clEv(); -} -function __ZZ14start_timeoutsvENK3$_0clEv(){ - _sys_check_timeouts(); -} -function __ZN7IpStack4initEPN6client9UpOptionsE(Lopts){ - __Z4initv(); - __Z16udpecho_raw_initv(); - __Z16tcpecho_raw_initv(); -} -function __ZN7IpStack2upEPN6client9UpOptionsE(Lopts){ - var LsavedStack=null,tmp1=null,Lip=0,LipMapStr=0,Lcall1=null,Lcall2=null,Lref$ptmp7=0,Lref$ptmp8=0,Lcall6=null,Li$p03=0,Lcall5=null,Lcall5o=0; - LsavedStack=___getStackPtr(); - tmp1=-80+LsavedStack|0; - ___setStackPtr(tmp1); - Lip=64+tmp1|0; - __ZNK6client6StringcvSsEv(Lip,Lopts.localIp); - LipMapStr=40+tmp1|0; - __ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEEC2Ev(LipMapStr); - Lcall1=Lopts.ipMap; - if(Lcall1!==undefined){ - Lcall2=Object.keys(Lcall1); - if(((Lcall2.length)|0)>0){ - Lref$ptmp7=24+tmp1|0; - Lref$ptmp8=8+tmp1|0; - Li$p03=0; - while(1){ - Lcall5=__ZN6client5ArrayixEi(Lcall2,Li$p03); - Lcall5o=oSlot; - Lcall5=Lcall5[Lcall5o]; - Lcall6=Lcall1[Lcall5]; - __ZNK6client6StringcvSsEv(Lref$ptmp7,Lcall5); - __ZNK6client6StringcvSsEv(Lref$ptmp8,Lcall6); - __ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEE7emplaceIJSsSsEEES4_ISt19__hash_map_iteratorISt15__hash_iteratorIPSt11__hash_nodeISt17__hash_value_typeISsSsEPvEEEbEDpOT_(tmp1|0,LipMapStr,Lref$ptmp7,Lref$ptmp8); - __ZNSsD2Ev(Lref$ptmp8); - __ZNSsD2Ev(Lref$ptmp7); - Li$p03=Li$p03+1|0; - if((Li$p03|0)<((Lcall2.length)|0))continue; - break; - } - } - } - __Z2upRKSsRKSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIS_SsEEE(Lip,LipMapStr); - __ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEED2Ev(LipMapStr); - __ZNSsD2Ev(Lip); - ___setStackPtr(LsavedStack); -} -function __ZNK6client6StringcvSsEv(Lagg$presult,Lthis){ - var Lcall2=null,Lcall2o=0,Li$p03=0; - __ZNSsC2Ev(Lagg$presult|0); - __ZNSs6resizeEj(Lagg$presult|0,Lthis.length); - Lcall2=HEAP8; - Lcall2o=__ZNSsixEj_icf(Lagg$presult|0)|0; - if(((Lthis.length)|0)>0){ - Li$p03=0; - while(1){ - Lcall2[Lcall2o+Li$p03|0]=Lthis.charCodeAt(Li$p03); - Li$p03=Li$p03+1|0; - if((Li$p03|0)<((Lthis.length)|0))continue; - break; - } - } -} -function __ZN6client5ArrayixEi(Lthis,Lindex){ - oSlot=0+Lindex|0; - return Lthis; -} -function __ZN7IpStack4downEv(){ - __Z4downv(); -} -function __ZN7IpStack5inputEPN6client10Uint8ArrayE(Lpkt){ - var Lconv=0,Lcall2=0,tmp2=null,tmp2o=0; - Lconv=~~ +Lpkt.length; - Lcall2=_pbuf_alloc(0,Lconv)|0; - if((Lcall2|0)!=(0|0)){ - tmp2o=HEAP32[4+Lcall2>>2]; - tmp2=HEAP8; - __ZN6cheerp14MakeTypedArrayIhN6client10Uint8ArrayEEEPT0_PKT_j(tmp2,tmp2o,Lconv).set(Lpkt); - __ZN7IpStackL7doInputEP4pbuf(Lcall2); - } -} -function __ZN7IpStack6outputEPFvPN6client10Uint8ArrayEE(Lcallback){ - __ZL9output_cb=Lcallback; -} -function __ZN7IpStack11recvAdapterEPN3tcp6SocketEPhj(Ls,Ldata,Mdata,Llen){ - var Lcall1=null; - Lcall1=__ZN6client4TMapIiPNS_14MessageChannelEE3getEi(__ZN7IpStackL7chanMapE,((Ls|0)|0)).port2; - if(__ZN7IpStack10isWasmNullIhEEbPT_(Ldata,Mdata)|0){ - __ZN3tcp6Socket5closeEv(Ls|0); - Lcall1.postMessage(null); - return; - } - Lcall1.postMessage(__ZN6cheerp14MakeTypedArrayIhN6client10Uint8ArrayEEEPT0_PKT_j(Ldata,Mdata,Llen)); -} -function __ZN6client4TMapIiPNS_14MessageChannelEE3getEi(Lthis,Lk){ - return Lthis.get(Lk); -} -function __ZN7IpStack10isWasmNullIhEEbPT_(Lp,Mp){ - var tmp0=0; - tmp0=(Lp.buffer===__heap); - if(tmp0){ - tmp0=Mp; - return ((tmp0|0)===0?1:0)|0; - } - return 0|0; -} -function __ZN7IpStack11connAdapterEPN3tcp6SocketEi(Ls,Lerr){ - var tmp0=0,Lcall=null,Lcall2=null; - tmp0=((Ls|0)|0); - Lcall=__ZN6client4TMapIiPNS_13EventListenerEE3getEi(__ZN7IpStackL11listenerMapE,tmp0); - Lcall2=__ZN6client4TMapIiPNS_14MessageChannelEE3getEi(__ZN7IpStackL7chanMapE,tmp0).port1; - if((Lerr|0)!==0)Lcall(null); - Lcall(Lcall2); -} -function __ZN6client4TMapIiPNS_13EventListenerEE3getEi(Lthis,Lk){ - return Lthis.get(Lk); -} -function __ZN7IpStack7parseIPEPN6client6StringE(LjsStr){ - var LsavedStack=null,tmp1=null,Lstr=0,Lcall=0; - LsavedStack=___getStackPtr(); - tmp1=-16+LsavedStack|0; - ___setStackPtr(tmp1); - Lstr=tmp1|0; - __ZNK6client6StringcvSsEv(Lstr,LjsStr); - Lcall=__ZN2ip4stonERKSs(Lstr)|0; - __ZNSsD2Ev(Lstr); - ___setStackPtr(LsavedStack); - return Lcall|0; -} -function __ZN7IpStack7connectEiii(LlocalPort,Lip,Lport){ - var Lcall=0,tmp1=0,Lp=null; - Lcall=__ZL6map_ipj(Lip)|0; - tmp1=_malloc(88)|0; - __ZN3tcp6SocketC2Ev(tmp1); - __ZN7IpStackL12setupChannelEPN3tcp6SocketE(tmp1); - if(((__ZN3tcp6Socket4bindEii(tmp1,LlocalPort)|0)&255)===0){ - Lp={a0:null,a1:null,a2:null}; - __Z13createPromisev(Lp); - __ZN6client4TMapIiPNS_13EventListenerEE3setEiS2_(__ZN7IpStackL11listenerMapE,(tmp1|0),Lp.a1); - if(((__ZN7IpStack11connectWasmEPN3tcp6SocketEii(tmp1,Lcall,Lport)|0)|0)===0)return Lp.a0; - } - __ZN3tcp6SocketD2Ev(tmp1); - _free(tmp1|0); - return null; -} -function __ZN7IpStackL12setupChannelEPN3tcp6SocketE(Ls){ - var Lcall1=null,LretConstructor=null; - LretConstructor=new MessageChannel(); - LretConstructor.port1; - Lcall1=LretConstructor.port2; - __ZN6client4TMapIiPNS_14MessageChannelEE3setEiS2_(__ZN7IpStackL7chanMapE,((Ls|0)|0),LretConstructor); - __ZN7IpStack8recvWasmEPN3tcp6SocketE(Ls|0); - LretConstructor={a0:null,a1:0}; - LretConstructor.a0=Lcall1; - LretConstructor.a1=(Ls|0); - Lcall1.onmessage=__ZN6cheerp8CallbackIZN7IpStackL12setupChannelEPN3tcp6SocketEE3$_7EEPN6client13EventListenerEOT_(LretConstructor); -} -function __ZN6client4TMapIiPNS_13EventListenerEE3setEiS2_(Lthis,Lk,Lv){ - Lthis.set(Lk,Lv); -} -function __ZN6client4TMapIiPNS_14MessageChannelEE3setEiS2_(Lthis,Lk,Lv){ - Lthis.set(Lk,Lv); -} -function __ZN6cheerp8CallbackIZN7IpStackL12setupChannelEPN3tcp6SocketEE3$_7EEPN6client13EventListenerEOT_(Lfunc){ - var Lref$ptmp=null,Lcall1=null; - Lref$ptmp={a0:null,a1:null,a2:null}; - __ZN6cheerp12make_closureIZN7IpStackL12setupChannelEPN3tcp6SocketEE3$_7EEDTclsr13ClosureHelperIT_DTadsr3std16remove_referenceIS6_E4typeEonclEEE12make_closureclgssr6cheerpE7forwardIS6_Efp_EEEOS6_(Lref$ptmp,Lfunc); - Lcall1=__ZN6cheerp7ClosureIFvPN6client12MessageEventEEEcvPNS1_13EventListenerEEv(Lref$ptmp); - __ZN6cheerp7ClosureIFvPN6client12MessageEventEEED2Ev(Lref$ptmp); - return Lcall1; -} -function __ZN6cheerp12make_closureIZN7IpStackL12setupChannelEPN3tcp6SocketEE3$_7EEDTclsr13ClosureHelperIT_DTadsr3std16remove_referenceIS6_E4typeEonclEEE12make_closureclgssr6cheerpE7forwardIS6_Efp_EEEOS6_(Lagg$presult,Lfunc){ - __ZN6cheerp13ClosureHelperIZN7IpStackL12setupChannelEPN3tcp6SocketEE3$_7MS5_KFvPN6client12MessageEventEEE12make_closureEOS5_(Lagg$presult,Lfunc); -} -function __ZN6cheerp7ClosureIFvPN6client12MessageEventEEEcvPNS1_13EventListenerEEv(Lthis){ - var tmp0=null; - if(Lthis.a1!==null){ - tmp0=[{a0:null,a1:null}]; - tmp0[0].a0=Lthis.a1; - tmp0[0].a1=Lthis.a2; - tmp0=cheerpCreateClosure(__ZN6cheerp7ClosureIFvPN6client12MessageEventEEE14deleter_helperEPNS5_13DeleterHelperE,tmp0[0]); - __ZN6cheerp20EscapedResourcesListIN6client13EventListenerEE3addEPS2_PNS1_6ObjectE(Lthis.a0,tmp0); - Lthis.a1=null; - } - return Lthis.a0; -} -function __ZN6cheerp7ClosureIFvPN6client12MessageEventEEED2Ev(Lthis){ - var tmp0=null; - tmp0=Lthis.a1; - if(tmp0!==null)tmp0(Lthis.a2); -} -function __ZN6cheerp7ClosureIFvPN6client12MessageEventEEE14deleter_helperEPNS5_13DeleterHelperE(Lh){ - Lh.a0(Lh.a1); -} -function __ZN6cheerp13ClosureHelperIZN7IpStackL12setupChannelEPN3tcp6SocketEE3$_7MS5_KFvPN6client12MessageEventEEE12make_closureEOS5_(Lagg$presult,Lfunc){ - __ZN6cheerp7ClosureIFvPN6client12MessageEventEEEC2IZN7IpStackL12setupChannelEPN3tcp6SocketEE3$_7EEOT_PNSt9enable_ifIXntsr3std14is_convertibleISC_PS4_EE5valueEvE4typeEPNSE_IXntsrNS5_13_must_destroyISC_EE5valueEvE4typeE(Lagg$presult,Lfunc); -} -function __ZN6cheerp7ClosureIFvPN6client12MessageEventEEEC2IZN7IpStackL12setupChannelEPN3tcp6SocketEE3$_7EEOT_PNSt9enable_ifIXntsr3std14is_convertibleISC_PS4_EE5valueEvE4typeEPNSE_IXntsrNS5_13_must_destroyISC_EE5valueEvE4typeE(Lthis,Lf){ - var tmp0=null,tmp1=null; - tmp0=[{a0:null,a1:0}]; - tmp0[0].a0=Lf.a0; - tmp0[0].a1=(Lf.a1|0); - tmp1=cheerpCreateClosure(__ZN6cheerp12InvokeHelperIvE6invokeIZN7IpStackL12setupChannelEPN3tcp6SocketEE3$_7JPN6client12MessageEventEEEEvPT_DpT0_,tmp0[0]); - Lthis.a0=tmp1; - Lthis.a1=null; - Lthis.a2=tmp0[0]; -} -function __ZN6cheerp12InvokeHelperIvE6invokeIZN7IpStackL12setupChannelEPN3tcp6SocketEE3$_7JPN6client12MessageEventEEEEvPT_DpT0_(Lfunc,Largs){ - __ZZN7IpStackL12setupChannelEPN3tcp6SocketEENK3$_7clEPN6client12MessageEventE(Lfunc,Largs); -} -function __ZZN7IpStackL12setupChannelEPN3tcp6SocketEENK3$_7clEPN6client12MessageEventE(Lthis,Lev){ - var LsavedStack=null,Lcall=null,Lbuf=0,Lcall8=null,Lcall8o=0,Lcall7=null,Lcall7o=0,Li$p03=0; - LsavedStack=___getStackPtr(); - Lcall7=-16+LsavedStack|0; - ___setStackPtr(Lcall7); - Lcall=Lev.data; - if(Lcall!==null){ - Lbuf=Lcall7|0; - __ZNSt6vectorIhSaIhEEC2Ej(Lbuf,~~ +Lcall.length); - if( +Lcall.length>0){ - Li$p03=0; - while(1){ - Lcall7=__ZN6client10Uint8ArrayixEi(Lcall,Li$p03); - Lcall7o=oSlot; - Lcall8=HEAP8; - Lcall8o=__ZNSt6vectorIhSaIhEEixEj(Lbuf,Li$p03)|0; - Lcall8[Lcall8o]=Lcall7[Lcall7o]|0; - Li$p03=Li$p03+1|0; - if( +Lcall.length>(+(Li$p03|0)))continue; - break; - } - } - __ZN7IpStack8sendWasmEPN3tcp6SocketERKSt6vectorIhSaIhEE(Lthis.a1|0,Lbuf); - __ZNSt6vectorIhSaIhEED2Ev(Lbuf); - }else{ - __ZN3tcp6Socket5closeEv(Lthis.a1|0); - Lthis.a0.onmessage=null; - } - ___setStackPtr(LsavedStack); -} -function __ZN6client10Uint8ArrayixEi(Lthis,Lindex){ - oSlot=0+Lindex|0; - return Lthis; -} -function __ZN7IpStack13acceptAdapterEPN3tcp6SocketES2_iii(LlistenSock,LnewSock,Laddr,Lport){ - var Lcall=0,Lcall2=null,Lcall4=null,tmp3=null; - Lcall=__ZL6map_ipj(Laddr)|0; - __ZN7IpStackL12setupChannelEPN3tcp6SocketE(LnewSock|0); - Lcall2=__ZN6client4TMapIiPNS_14MessageChannelEE3getEi(__ZN7IpStackL7chanMapE,((LlistenSock|0)|0)).port2; - Lcall4=__ZN6client4TMapIiPNS_14MessageChannelEE3getEi(__ZN7IpStackL7chanMapE,((LnewSock|0)|0)).port1; - tmp3={addr: Lcall, port: Lport, arg1: Lcall4}; - Lcall2.postMessage(tmp3,new Array(Lcall4)); -} -function __ZN7IpStack6listenEi(LlocalPort){ - var tmp0=0,Lcall9=null,Lcall10=null,LretConstructor=null; - tmp0=_malloc(88)|0; - __ZN3tcp6SocketC2Ev(tmp0); - if(((__ZN3tcp6Socket4bindEii(tmp0,LlocalPort)|0)&255)===0)if(((__ZN3tcp6Socket6listenEv(tmp0)|0)&255)===0){ - LretConstructor=new MessageChannel(); - Lcall9=LretConstructor.port1; - Lcall10=LretConstructor.port2; - __ZN6client4TMapIiPNS_14MessageChannelEE3setEiS2_(__ZN7IpStackL7chanMapE,(tmp0|0),LretConstructor); - __ZN7IpStack10acceptWasmEPN3tcp6SocketE(tmp0); - LretConstructor={a0:0}; - LretConstructor.a0=tmp0; - Lcall10.onmessage=__ZN6cheerp8CallbackIZN7IpStack6listenEiE3$_4EEPN6client13EventListenerEOT_(LretConstructor); - return Lcall9; - } - __ZN3tcp6SocketD2Ev(tmp0); - _free(tmp0|0); - return null; -} -function __ZN6cheerp8CallbackIZN7IpStack6listenEiE3$_4EEPN6client13EventListenerEOT_(Lfunc){ - var Lref$ptmp=null,Lcall1=null; - Lref$ptmp={a0:null,a1:null,a2:null}; - __ZN6cheerp12make_closureIZN7IpStack6listenEiE3$_4EEDTclsr13ClosureHelperIT_DTadsr3std16remove_referenceIS3_E4typeEonclEEE12make_closureclgssr6cheerpE7forwardIS3_Efp_EEEOS3_(Lref$ptmp,Lfunc); - Lcall1=__ZN6cheerp7ClosureIFvPN6client12MessageEventEEEcvPNS1_13EventListenerEEv(Lref$ptmp); - __ZN6cheerp7ClosureIFvPN6client12MessageEventEEED2Ev(Lref$ptmp); - return Lcall1; -} -function __ZN6cheerp12make_closureIZN7IpStack6listenEiE3$_4EEDTclsr13ClosureHelperIT_DTadsr3std16remove_referenceIS3_E4typeEonclEEE12make_closureclgssr6cheerpE7forwardIS3_Efp_EEEOS3_(Lagg$presult,Lfunc){ - __ZN6cheerp13ClosureHelperIZN7IpStack6listenEiE3$_4MS2_KFvPN6client12MessageEventEEE12make_closureEOS2_(Lagg$presult,Lfunc); -} -function __ZN6cheerp13ClosureHelperIZN7IpStack6listenEiE3$_4MS2_KFvPN6client12MessageEventEEE12make_closureEOS2_(Lagg$presult,Lfunc){ - __ZN6cheerp7ClosureIFvPN6client12MessageEventEEEC2IZN7IpStack6listenEiE3$_4EEOT_PNSt9enable_ifIXntsr3std14is_convertibleIS9_PS4_EE5valueEvE4typeEPNSB_IXntsrNS5_13_must_destroyIS9_EE5valueEvE4typeE(Lagg$presult,Lfunc); -} -function __ZN6cheerp7ClosureIFvPN6client12MessageEventEEEC2IZN7IpStack6listenEiE3$_4EEOT_PNSt9enable_ifIXntsr3std14is_convertibleIS9_PS4_EE5valueEvE4typeEPNSB_IXntsrNS5_13_must_destroyIS9_EE5valueEvE4typeE(Lthis,Lf){ - var tmp0=null,tmp1=null; - tmp0=[{a0:0}]; - tmp0[0].a0=(Lf.a0|0); - tmp1=cheerpCreateClosure(__ZN6cheerp12InvokeHelperIvE6invokeIZN7IpStack6listenEiE3$_4JPN6client12MessageEventEEEEvPT_DpT0_,tmp0[0]); - Lthis.a0=tmp1; - Lthis.a1=null; - Lthis.a2=tmp0[0]; -} -function __ZN6cheerp12InvokeHelperIvE6invokeIZN7IpStack6listenEiE3$_4JPN6client12MessageEventEEEEvPT_DpT0_(Lfunc,Largs){ - __ZZN7IpStack6listenEiENK3$_4clEPN6client12MessageEventE(Lfunc); -} -function __ZZN7IpStack6listenEiENK3$_4clEPN6client12MessageEventE(Lthis){ - __ZN3tcp6Socket5closeEv(Lthis.a0|0); -} -function __ZN7IpStack14recvAdapterUdpEPN3udp6SocketEPhjii(Ls,Ldata,Mdata,Llen,Laddr,Lport){ - var Lcall=0,Lcall2=null; - Lcall=__ZL6map_ipj(Laddr)|0; - Lcall2=__ZN6client4TMapIiPNS_14MessageChannelEE3getEi(__ZN7IpStackL7chanMapE,((Ls|0)|0)).port2; - Lcall2.postMessage({addr: Lcall, port: Lport, data: __ZN6cheerp14MakeTypedArrayIhN6client10Uint8ArrayEEEPT0_PKT_j(Ldata,Mdata,Llen)}); -} -function __ZN7IpStack4bindEi(LlocalPort){ - var tmp0=0,Lcall1=null,Lcall2=null,LretConstructor=null; - tmp0=_malloc(32)|0; - __ZN3udp6SocketC2Ev(tmp0); - if(((__ZN3udp6Socket4bindEii(tmp0,LlocalPort)|0)&255)!==0){ - __ZN3udp6SocketD2Ev(tmp0); - _free(tmp0|0); - return null; - } - LretConstructor=new MessageChannel(); - Lcall1=LretConstructor.port1; - Lcall2=LretConstructor.port2; - __ZN6client4TMapIiPNS_14MessageChannelEE3setEiS2_(__ZN7IpStackL7chanMapE,(tmp0|0),LretConstructor); - __ZN7IpStack11recvWasmUdpEPN3udp6SocketE(tmp0); - LretConstructor={a0:0}; - LretConstructor.a0=tmp0; - Lcall2.onmessage=__ZN6cheerp8CallbackIZN7IpStack4bindEiE3$_6EEPN6client13EventListenerEOT_(LretConstructor); - return Lcall1; -} -function __ZN6cheerp8CallbackIZN7IpStack4bindEiE3$_6EEPN6client13EventListenerEOT_(Lfunc){ - var Lref$ptmp=null,Lcall1=null; - Lref$ptmp={a0:null,a1:null,a2:null}; - __ZN6cheerp12make_closureIZN7IpStack4bindEiE3$_6EEDTclsr13ClosureHelperIT_DTadsr3std16remove_referenceIS3_E4typeEonclEEE12make_closureclgssr6cheerpE7forwardIS3_Efp_EEEOS3_(Lref$ptmp,Lfunc); - Lcall1=__ZN6cheerp7ClosureIFvPN6client12MessageEventEEEcvPNS1_13EventListenerEEv(Lref$ptmp); - __ZN6cheerp7ClosureIFvPN6client12MessageEventEEED2Ev(Lref$ptmp); - return Lcall1; -} -function __ZN6cheerp12make_closureIZN7IpStack4bindEiE3$_6EEDTclsr13ClosureHelperIT_DTadsr3std16remove_referenceIS3_E4typeEonclEEE12make_closureclgssr6cheerpE7forwardIS3_Efp_EEEOS3_(Lagg$presult,Lfunc){ - __ZN6cheerp13ClosureHelperIZN7IpStack4bindEiE3$_6MS2_KFvPN6client12MessageEventEEE12make_closureEOS2_(Lagg$presult,Lfunc); -} -function __ZN6cheerp13ClosureHelperIZN7IpStack4bindEiE3$_6MS2_KFvPN6client12MessageEventEEE12make_closureEOS2_(Lagg$presult,Lfunc){ - __ZN6cheerp7ClosureIFvPN6client12MessageEventEEEC2IZN7IpStack4bindEiE3$_6EEOT_PNSt9enable_ifIXntsr3std14is_convertibleIS9_PS4_EE5valueEvE4typeEPNSB_IXntsrNS5_13_must_destroyIS9_EE5valueEvE4typeE(Lagg$presult,Lfunc); -} -function __ZN6cheerp7ClosureIFvPN6client12MessageEventEEEC2IZN7IpStack4bindEiE3$_6EEOT_PNSt9enable_ifIXntsr3std14is_convertibleIS9_PS4_EE5valueEvE4typeEPNSB_IXntsrNS5_13_must_destroyIS9_EE5valueEvE4typeE(Lthis,Lf){ - var tmp0=null,tmp1=null; - tmp0=[{a0:0}]; - tmp0[0].a0=(Lf.a0|0); - tmp1=cheerpCreateClosure(__ZN6cheerp12InvokeHelperIvE6invokeIZN7IpStack4bindEiE3$_6JPN6client12MessageEventEEEEvPT_DpT0_,tmp0[0]); - Lthis.a0=tmp1; - Lthis.a1=null; - Lthis.a2=tmp0[0]; -} -function __ZN6cheerp12InvokeHelperIvE6invokeIZN7IpStack4bindEiE3$_6JPN6client12MessageEventEEEEvPT_DpT0_(Lfunc,Largs){ - __ZZN7IpStack4bindEiENK3$_6clEPN6client12MessageEventE(Lfunc,Largs); -} -function __ZZN7IpStack4bindEiENK3$_6clEPN6client12MessageEventE(Lthis,Lev){ - var LsavedStack=null,Lcall=null,Lcall3=null,Lbuf=0,Lcall9=null,Lcall9o=0,Lcall11=0,Lcall8=null,Lcall8o=0,Li$p03=0; - LsavedStack=___getStackPtr(); - Lcall8=-16+LsavedStack|0; - ___setStackPtr(Lcall8); - Lcall=Lev.data; - if(Lcall!==null){ - Lcall3=Lcall.data; - Lbuf=Lcall8|0; - __ZNSt6vectorIhSaIhEEC2Ej(Lbuf,~~ +Lcall3.length); - if( +Lcall3.length>0){ - Li$p03=0; - while(1){ - Lcall8=__ZN6client10Uint8ArrayixEi(Lcall3,Li$p03); - Lcall8o=oSlot; - Lcall9=HEAP8; - Lcall9o=__ZNSt6vectorIhSaIhEEixEj(Lbuf,Li$p03)|0; - Lcall9[Lcall9o]=Lcall8[Lcall8o]|0; - Li$p03=Li$p03+1|0; - if( +Lcall3.length>(+(Li$p03|0)))continue; - break; - } - } - Li$p03=Lcall.addr; - Lcall11=Lcall.port; - __ZN7IpStack11sendWasmUdpEPN3udp6SocketERKSt6vectorIhSaIhEEjj(Lthis.a0|0,Lbuf,Li$p03,Lcall11); - __ZNSt6vectorIhSaIhEED2Ev(Lbuf); - }else __ZN3udp6Socket5closeEv(Lthis.a0|0); - ___setStackPtr(LsavedStack); -} -function __ZN10__cxxabiv1L24__cxa_throw_wasm_adapterEjPSt9type_infoj(Lthrown_object){ - var Ldest$paddr=null,Lref$ptmp=null,Ltinfo$paddr=null; - Ltinfo$paddr=[0]; - Ltinfo$paddr[0]=(1048584|0); - Ldest$paddr=[0]; - Ldest$paddr[0]=((58|0)|0); - Lref$ptmp=[nullObj]; - Lref$ptmp[0]={d:null,o:Lthrown_object}; - Ltinfo$paddr=__ZN10__cxxabiv19Exception8allocateIJPvRPSt9type_infoRjEEEPS0_DpOT_(Lref$ptmp,0,Ltinfo$paddr,0,Ldest$paddr,0); - __ZN10__cxxabiv1L8do_throwEPNS_9ExceptionE(Ltinfo$paddr); - ; -} -function __ZN10__cxxabiv19Exception8allocateIJPvRPSt9type_infoRjEEEPS0_DpOT_(Largs,Margs,Largs1,Margs1,Largs3,Margs3){ - var tmp0=0,Lid$p0$plcssa28$pi$pi=0,tmp2=null,Lid$p022$pi$pi=0,tmp4=null; - Lid$p0$plcssa28$pi$pi=__ZN10__cxxabiv19Exception9allocatorE$p2|0; - a:{ - b:{ - if((Lid$p0$plcssa28$pi$pi|0)>1){ - tmp2=__ZN10__cxxabiv19Exception9allocatorE$p1; - Lid$p022$pi$pi=1; - while(1){ - if((tmp2[Lid$p022$pi$pi]&255)!==0){ - Lid$p022$pi$pi=Lid$p022$pi$pi+1|0; - if((Lid$p022$pi$pi|0)===(Lid$p0$plcssa28$pi$pi|0))break b; - continue; - } - break; - } - }else{ - Lid$p022$pi$pi=1; - } - if((Lid$p022$pi$pi|0)!==(Lid$p0$plcssa28$pi$pi|0)){ - Lid$p0$plcssa28$pi$pi=Lid$p022$pi$pi; - break a; - } - } - __ZN10__cxxabiv19Exception9allocatorE$p2=Lid$p0$plcssa28$pi$pi<<1; - tmp2=__ZN10__cxxabiv19Exception9allocatorE$p0; - Lid$p022$pi$pi=__imul(Lid$p0$plcssa28$pi$pi,88)|0; - if(tmp2!==nullArray||0!==0)tmp2=resizeArray_struct$p_ZN10__cxxabiv19ExceptionE(tmp2,tmp2.length,Lid$p022$pi$pi/44|0); - else tmp2=createArray_struct$p_ZN10__cxxabiv19ExceptionE(Lid$p022$pi$pi/44|0); - __ZN10__cxxabiv19Exception9allocatorE$p0=tmp2; - Lid$p022$pi$pi=__ZN10__cxxabiv19Exception9allocatorE$p2|0; - tmp2=__ZN10__cxxabiv19Exception9allocatorE$p1; - if(tmp2!==nullArray||0!==0)tmp2=(function(){var __old__=tmp2; - var __ret__=new Uint8Array(Lid$p022$pi$pi/1|0); - __ret__.set(__old__.subarray(0, Math.min(__ret__.length,__old__.length))); - return __ret__;})(); - else tmp2=new Uint8Array(Lid$p022$pi$pi/1|0); - __ZN10__cxxabiv19Exception9allocatorE$p1=tmp2; - } - tmp2=__ZN10__cxxabiv19Exception9allocatorE$p0; - tmp4=Largs[Margs]; - Lid$p022$pi$pi=Largs1[Margs1]|0; - tmp0=Largs3[Margs3]|0; - tmp2[Lid$p0$plcssa28$pi$pi].a1=tmp4.d[tmp4.o]; - tmp2[Lid$p0$plcssa28$pi$pi].a2=null; - tmp2[Lid$p0$plcssa28$pi$pi].a3=Lid$p022$pi$pi; - tmp2[Lid$p0$plcssa28$pi$pi].a4=null; - tmp2[Lid$p0$plcssa28$pi$pi].i5=tmp0; - tmp2[Lid$p0$plcssa28$pi$pi].i6=1; - tmp2[Lid$p0$plcssa28$pi$pi].i7=0; - tmp2[Lid$p0$plcssa28$pi$pi].a9=null; - tmp2[Lid$p0$plcssa28$pi$pi].a10=null; - tmp4=__ZN10__cxxabiv19Exception9allocatorE$p1; - tmp4[Lid$p0$plcssa28$pi$pi]=1; - return tmp2[Lid$p0$plcssa28$pi$pi]; -} -function __ZN10__cxxabiv1L8do_throwEPNS_9ExceptionE(Lex){ - var tmp0=0,LretConstructor8=null,LretConstructor=null,LretConstructoro=0; - tmp0=Lex.a3|0; - LretConstructoro=HEAP32[4+tmp0>>2]; - LretConstructor=HEAP8; - LretConstructor=_cheerpCreate_ZN6client6StringC2EPKc(LretConstructor,LretConstructoro); - LretConstructor8=new CheerpException(LretConstructor); - Lex.a0=LretConstructor8; - throw LretConstructor8; - ; -} -function _cheerpCreate_ZN6client6StringC2EPKc(Larg0,Marg0){ - var LretConstructor$pi=null,Lgeptoindexphi=0,LcheerpPtrAlloca$p07$pi=null; - LretConstructor$pi=String(); - if((Larg0[Marg0]&255)===0)return String(LretConstructor$pi); - Lgeptoindexphi=0; - while(1){ - LcheerpPtrAlloca$p07$pi=String.fromCharCode(Larg0[Marg0+Lgeptoindexphi|0]<<24>>24); - LretConstructor$pi=LretConstructor$pi.concat(LcheerpPtrAlloca$p07$pi); - Lgeptoindexphi=Lgeptoindexphi+1|0; - if((Larg0[Marg0+Lgeptoindexphi|0]&255)!==0)continue; - break; - } - return String(LretConstructor$pi); -} -function _print(Lbuf,Mbuf,Llen){ - var Lcall=null,Lsub=0; - Lcall=__ZN6client6String8fromUtf8EPKcj(Lbuf,Mbuf,Llen); - Lsub=(Lcall.length)-1|0; - if(((Lcall.charCodeAt(Lsub))|0)===10){ - console.log(Lcall.substr(0,Lsub)); - return; - } - console.log(Lcall); -} -function __ZN6client6String8fromUtf8EPKcj(Lin,Min,Llen){ - var tmp0=0,LretConstructor=null,Lgeptoindexphi=0,Llen$paddr$p06=0,Lcodepoint$p03=0,Lconv2=0; - LretConstructor=String(); - if((Llen|0)===0)return LretConstructor; - Llen$paddr$p06=Llen; - Lgeptoindexphi=0; - while(1){ - tmp0=Lin[Min+Lgeptoindexphi|0]|0; - if((tmp0&255)!==0){ - Lconv2=tmp0&255; - if(tmp0<<24<=-16777216)if((tmp0&255)<192){ - Lconv2=(Lconv2&63)+(Lcodepoint$p03<<6)|0; - }else if((tmp0&255)<224){ - Lconv2&=31; - }else if((tmp0&255)<240){ - Lconv2&=15; - }else{ - Lconv2&=7; - } - Llen$paddr$p06=Llen$paddr$p06-1|0; - Lgeptoindexphi=Lgeptoindexphi+1|0; - a:{ - if((Llen$paddr$p06|0)!==0)if((Lin[Min+Lgeptoindexphi|0]&192)===128){ - Lcodepoint$p03=Lconv2; - break a; - } - if(Lconv2>>>0<65536){ - Lcodepoint$p03=Lconv2; - }else{ - Lcodepoint$p03=Lconv2-65536|0; - LretConstructor=LretConstructor.concat(String.fromCharCode((Lcodepoint$p03>>>10)+55296|0)); - Lconv2=(Lconv2&1023)+56320|0; - } - LretConstructor=LretConstructor.concat(String.fromCharCode(Lconv2)); - } - if((Llen$paddr$p06|0)!==0)continue; - return LretConstructor; - } - break; - } - return LretConstructor; -} -function __start(){ - ___cxx_global_var_init(); - ___cxx_global_var_init$p2(); - ___cxx_global_var_init$p3(); -} -function ___wrapper__print(Larg0,Larg1){ - _print(HEAP8,Larg0>>0,Larg1); -} -function ___wrapper___ZN7IpStack14recvAdapterUdpEPN3udp6SocketEPhjii(Larg0,Larg1,Larg2,Larg3,Larg4){ - __ZN7IpStack14recvAdapterUdpEPN3udp6SocketEPhjii(Larg0|0,HEAP8,Larg1>>0,Larg2,Larg3,Larg4); -} -function ___wrapper___ZN7IpStack11recvAdapterEPN3tcp6SocketEPhj(Larg0,Larg1,Larg2){ - __ZN7IpStack11recvAdapterEPN3tcp6SocketEPhj(Larg0|0,HEAP8,Larg1>>0,Larg2); -} -function ___wrapper___Z9output_jsPhi(Larg0,Larg1){ - __Z9output_jsPhi(HEAP8,Larg0>>0,Larg1); -} -var __ZN7IpStackL11listenerMapE=null; -var __ZN7IpStackL7chanMapE=null; -var __ZN6cheerp20EscapedResourcesListIN6client13EventListenerEE9resourcesE=null; -var __ZL9output_cb=null; -var __ZN10__cxxabiv19Exception9allocatorE$p2=16; -var _promotedMalloc$p6=new Uint8Array(16); -var __ZN10__cxxabiv19Exception9allocatorE$p1=_promotedMalloc$p6; -var _promotedMalloc$p5=createArray_struct$p_ZN10__cxxabiv19ExceptionE(16); -var __ZN10__cxxabiv19Exception9allocatorE$p0=_promotedMalloc$p5; -function constructor_struct$p_ZN10__cxxabiv19ExceptionE(){ - this.a0=null; - this.a1=null; - this.a2=null; - this.a3=0; - this.a4=null; - this.i5=0; - this.i6=0; - this.i7=0; - this.a8=null; - this.a9=null; - this.a10=null; -} -function createArray_struct$p_ZN10__cxxabiv19ExceptionE(e){ - var r=[]; - for(var i=0;i>16; - try{ - __asm.memory.grow(pages); - __heap=__asm.memory.buffer; - assignHeaps(__heap); - return pages<<16; - }catch(e){ - return -1; - } -} -var IpStack={ - bind:null, - connect:null, - down:null, - init:null, - input:null, - listen:null, - output:null, - parseIP:null, - up:null, -}; -var HEAP8=null,HEAP32=null,__asm=null,__heap=null;function __dummy(){throw new Error('this should be unreachable');}; -var ___cxx_global_var_init=null; -var _malloc=null; -var __ZN3udp6SocketC2Ev=null; -var __ZN3udp6Socket4bindEii=null; -var __ZN3udp6SocketD2Ev=null; -var __ZN7IpStack11recvWasmUdpEPN3udp6SocketE=null; -var __ZN3udp6Socket5closeEv=null; -var __ZNSt6vectorIhSaIhEEC2Ej=null; -var __ZNSt6vectorIhSaIhEEixEj=null; -var __ZN7IpStack11sendWasmUdpEPN3udp6SocketERKSt6vectorIhSaIhEEjj=null; -var __ZNSt6vectorIhSaIhEED2Ev=null; -var __ZL6map_ipj=null; -var __ZN3tcp6SocketC2Ev=null; -var __ZN3tcp6Socket4bindEii=null; -var __ZN3tcp6Socket6listenEv=null; -var __ZN7IpStack10acceptWasmEPN3tcp6SocketE=null; -var __ZN3tcp6SocketD2Ev=null; -var __ZN3tcp6Socket5closeEv=null; -var __ZN7IpStack8recvWasmEPN3tcp6SocketE=null; -var __ZN7IpStack8sendWasmEPN3tcp6SocketERKSt6vectorIhSaIhEE=null; -var __ZN7IpStack11connectWasmEPN3tcp6SocketEii=null; -var __ZN2ip4stonERKSs=null; -var __ZNSsD2Ev=null; -var __ZNSsC2Ev=null; -var __ZNSs6resizeEj=null; -var __ZNSsixEj_icf=null; -var _pbuf_alloc=null; -var __ZN7IpStackL7doInputEP4pbuf=null; -var __Z4downv=null; -var __ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEEC2Ev=null; -var __ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEE7emplaceIJSsSsEEES4_ISt19__hash_map_iteratorISt15__hash_iteratorIPSt11__hash_nodeISt17__hash_value_typeISsSsEPvEEEbEDpOT_=null; -var __Z2upRKSsRKSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIS_SsEEE=null; -var __ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEED2Ev=null; -var __Z4initv=null; -var __Z16udpecho_raw_initv=null; -var __Z16tcpecho_raw_initv=null; -var _sys_check_timeouts=null; -var _free=null; -var ___getStackPtr=null; -var ___setStackPtr=null; -export default function(Lh){ - return (Lh&&Lh.buffer)? - Promise.resolve(Lh.buffer): - fetchBuffer((Lh&&Lh.absPath)?Lh.absPath:new URL('ipstack.wasm', import.meta.url)).then(Lh=> - WebAssembly.instantiate(Lh, - {i:{ - ___syscall_rt_sigprocmask:__dummy, - ___syscall_rt_sigaction:__dummy, - ___syscall_tkill:__dummy, - ___syscall_exit_group:__dummy, - ___syscall_exit:__dummy, - ___syscall_futex:__dummy, - ___syscall__llseek:__dummy, - ___wrapper___Z9output_jsPhi:___wrapper___Z9output_jsPhi, - ___syscall_close:__dummy, - ___wrapper___ZN7IpStack11recvAdapterEPN3tcp6SocketEPhj:___wrapper___ZN7IpStack11recvAdapterEPN3tcp6SocketEPhj, - __ZN7IpStack13acceptAdapterEPN3tcp6SocketES2_iii:__ZN7IpStack13acceptAdapterEPN3tcp6SocketES2_iii, - ___wrapper___ZN7IpStack14recvAdapterUdpEPN3udp6SocketEPhjii:___wrapper___ZN7IpStack14recvAdapterUdpEPN3udp6SocketEPhjii, - __ZN7IpStack11connAdapterEPN3tcp6SocketEi:__ZN7IpStack11connAdapterEPN3tcp6SocketEi, - _sys_now:_sys_now, - __ZN10__cxxabiv1L24__cxa_throw_wasm_adapterEjPSt9type_infoj:__ZN10__cxxabiv1L24__cxa_throw_wasm_adapterEjPSt9type_infoj, - __Z14start_timeoutsv:__Z14start_timeoutsv, - ___wrapper__print:___wrapper__print, - growLinearMemory:growLinearMemory, - }}) - ).then(Lh=>{ - __asm=Lh.instance.exports; - __heap=__asm.memory.buffer; - assignHeaps(__heap); - ___cxx_global_var_init=__asm.___cxx_global_var_init; - _malloc=__asm._malloc; - __ZN3udp6SocketC2Ev=__asm.__ZN3udp6SocketC2Ev; - __ZN3udp6Socket4bindEii=__asm.__ZN3udp6Socket4bindEii; - __ZN3udp6SocketD2Ev=__asm.__ZN3udp6SocketD2Ev; - __ZN7IpStack11recvWasmUdpEPN3udp6SocketE=__asm.__ZN7IpStack11recvWasmUdpEPN3udp6SocketE; - __ZN3udp6Socket5closeEv=__asm.__ZN3udp6Socket5closeEv; - __ZNSt6vectorIhSaIhEEC2Ej=__asm.__ZNSt6vectorIhSaIhEEC2Ej; - __ZNSt6vectorIhSaIhEEixEj=__asm.__ZNSt6vectorIhSaIhEEixEj; - __ZN7IpStack11sendWasmUdpEPN3udp6SocketERKSt6vectorIhSaIhEEjj=__asm.__ZN7IpStack11sendWasmUdpEPN3udp6SocketERKSt6vectorIhSaIhEEjj; - __ZNSt6vectorIhSaIhEED2Ev=__asm.__ZNSt6vectorIhSaIhEED2Ev; - __ZL6map_ipj=__asm.__ZL6map_ipj; - __ZN3tcp6SocketC2Ev=__asm.__ZN3tcp6SocketC2Ev; - __ZN3tcp6Socket4bindEii=__asm.__ZN3tcp6Socket4bindEii; - __ZN3tcp6Socket6listenEv=__asm.__ZN3tcp6Socket6listenEv; - __ZN7IpStack10acceptWasmEPN3tcp6SocketE=__asm.__ZN7IpStack10acceptWasmEPN3tcp6SocketE; - __ZN3tcp6SocketD2Ev=__asm.__ZN3tcp6SocketD2Ev; - __ZN3tcp6Socket5closeEv=__asm.__ZN3tcp6Socket5closeEv; - __ZN7IpStack8recvWasmEPN3tcp6SocketE=__asm.__ZN7IpStack8recvWasmEPN3tcp6SocketE; - __ZN7IpStack8sendWasmEPN3tcp6SocketERKSt6vectorIhSaIhEE=__asm.__ZN7IpStack8sendWasmEPN3tcp6SocketERKSt6vectorIhSaIhEE; - __ZN7IpStack11connectWasmEPN3tcp6SocketEii=__asm.__ZN7IpStack11connectWasmEPN3tcp6SocketEii; - __ZN2ip4stonERKSs=__asm.__ZN2ip4stonERKSs; - __ZNSsD2Ev=__asm.__ZNSsD2Ev; - __ZNSsC2Ev=__asm.__ZNSsC2Ev; - __ZNSs6resizeEj=__asm.__ZNSs6resizeEj; - __ZNSsixEj_icf=__asm.__ZNSsixEj_icf; - _pbuf_alloc=__asm._pbuf_alloc; - __ZN7IpStackL7doInputEP4pbuf=__asm.__ZN7IpStackL7doInputEP4pbuf; - __Z4downv=__asm.__Z4downv; - __ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEEC2Ev=__asm.__ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEEC2Ev; - __ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEE7emplaceIJSsSsEEES4_ISt19__hash_map_iteratorISt15__hash_iteratorIPSt11__hash_nodeISt17__hash_value_typeISsSsEPvEEEbEDpOT_=__asm.__ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEE7emplaceIJSsSsEEES4_ISt19__hash_map_iteratorISt15__hash_iteratorIPSt11__hash_nodeISt17__hash_value_typeISsSsEPvEEEbEDpOT_; - __Z2upRKSsRKSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIS_SsEEE=__asm.__Z2upRKSsRKSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIS_SsEEE; - __ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEED2Ev=__asm.__ZNSt13unordered_mapISsSsSt4hashISsESt8equal_toISsESaISt4pairIKSsSsEEED2Ev; - __Z4initv=__asm.__Z4initv; - __Z16udpecho_raw_initv=__asm.__Z16udpecho_raw_initv; - __Z16tcpecho_raw_initv=__asm.__Z16tcpecho_raw_initv; - _sys_check_timeouts=__asm._sys_check_timeouts; - _free=__asm._free; - ___getStackPtr=__asm.___getStackPtr; - ___setStackPtr=__asm.___setStackPtr; - IpStack.bind=__ZN7IpStack4bindEi; - IpStack.connect=__ZN7IpStack7connectEiii; - IpStack.down=__ZN7IpStack4downEv; - IpStack.init=__ZN7IpStack4initEPN6client9UpOptionsE; - IpStack.input=__ZN7IpStack5inputEPN6client10Uint8ArrayE; - IpStack.listen=__ZN7IpStack6listenEi; - IpStack.output=__ZN7IpStack6outputEPFvPN6client10Uint8ArrayEE; - IpStack.parseIP=__ZN7IpStack7parseIPEPN6client6StringE; - IpStack.up=__ZN7IpStack2upEPN6client9UpOptionsE; - __start(); - return{ - IpStack:IpStack, - }; - }); -} -function assignHeaps(Lh){ - HEAP8=new Uint8Array(Lh); - HEAP32=new Int32Array(Lh); -} +"use strict";/*Compiled using Cheerp (R) by Leaning Technologies Ltd*/var se=Math.imul;var sf=Math.fround;var oSlot=0;var nullArray=[null];var nullObj={d:nullArray,o:0};function sE(p){return (typeof self==='object')?fetch(p).then(r=>r.arrayBuffer()):new Promise((y,n)=>{import('fs').then(r=>r.readFile(p,(e,d)=>{if(e)n(e);else y(d);}));});}function ox(){aX=ou();}function ow(){eb=ov();}function ov(){return new Map();}function ou(){return new Map();}function pQ(k){var i=null,g=null;i=gJ();g=gJ();k.a0=new Promise(function(__f,__r){i.inner=__f;g.inner=__r;});;k.a1=i.inner;k.a2=g.inner;}function gJ(){return new Object();}function d8(){return ~~ +performance.now()|0;}function pN(k,l,i){var g=null;g=new Uint8Array((+(i|0)));g.set(cY(k,l,i));g8(g);}function cY(k,l,i){var m=0,g=null;m=l;g=k;g=g;if((i|0)!==0){if((m|0)===0)if( +g.length===(+(i>>>0)))return g;return g.subarray((+(m>>>0)),(+(m+i>>>0)));}if((m|0)===0)return g;return g.subarray((+(m>>>0)));}function pH(){+setInterval(pG(),10);}function pG(){var g=null,i=null;g={a0:null,a1:null,a2:null};n3(g);i=n2(g);n1(g);return i;}function n3(g){nS(g);}function n2(i){var g=null;if(i.a1!==null){g=[{a0:null,a1:null}];g[0].a0=i.a1;g[0].a1=i.a2;g=sv(nZ,g[0]);gv(i.a0,g);i.a1=null;}return i.a0;}function n1(i){var g=null;g=i.a1;if(g!==null)g(i.a2);}function nZ(g){g.a0(g.a1);}function gv(i,g){if(eh===null)eh=new Map();eh.set(i,g);}function nS(g){nR(g);}function nR(g){var i=null;i=nP;g.a0=i;g.a1=null;g.a2=null;}function nP(){nO();}function nO(){lx();}function rY(g){nN();iP();iN();}function rX(F){var A=null,g=null,v=0,k=0,t=null,q=null,o=0,m=0,D=null,i=0,x=null,y=0;A=cf();g=-80+A|0;aZ(g);v=64+g|0;cR(v,F.localIp);k=40+g|0;m3(k);t=F.ipMap;if(t!==undefined){q=Object.keys(t);if(((q.length)|0)>0){o=24+g|0;m=8+g|0;i=0;while(1){x=m0(q,i);y=oSlot;x=x[y];D=t[x];cR(o,x);cR(m,D);mY(g|0,k,o,m);cC(m);cC(o);i=i+1|0;if((i|0)<((q.length)|0))continue;break;}}}nJ(v,k);mX(k);cC(v);aZ(A);}function cR(k,i){var m=null,n=0,g=0;od(k|0);qn(k|0,i.length);m=a;n=b6(k|0)|0;if(((i.length)|0)>0){g=0;while(1){m[n+g|0]=i.charCodeAt(g);g=g+1|0;if((g|0)<((i.length)|0))continue;break;}}}function m0(i,g){oSlot=0+g|0;return i;}function r4(){m5();}function r3(m){var i=0,g=0,k=null,l=0;i=~~ +m.length;g=ak(0,i)|0;if((g|0)!=(0|0)){l=c[4+g>>2];k=a;cY(k,l,i).set(m);oa(g);}}function r1(g){g8=g;}function n$(m,k,l,i){var g=null;g=b4(aX,((m|0)|0)).port2;if(n_(k,l)|0){dN(m|0);g.postMessage(null);return;}g.postMessage(cY(k,l,i));}function b4(i,g){return i.get(g);}function n_(i,j){var g=0;g=(i.buffer===__heap);if(g){g=j;return ((g|0)===0?1:0)|0;}return 0|0;}function kT(k,i){var g=0,o=null,m=null;g=((k|0)|0);o=kS(eb,g);m=b4(aX,g).port1;if((i|0)!==0)o(null);o(m);}function kS(i,g){return i.get(g);}function r0(o){var k=null,i=null,g=0,m=0;k=cf();i=-16+k|0;aZ(i);g=i|0;cR(g,o);m=iI(g)|0;cC(g);aZ(k);return m|0;}function rZ(q,o,m){var k=0,g=0,i=null;k=cT(o)|0;g=aD(88)|0;eF(g);gm(g);if(((ez(g,q)|0)&255)===0){i={a0:null,a1:null,a2:null};pQ(i);ns(eb,(g|0),i.a1);if(((kQ(g,k,m)|0)|0)===0)return i.a0;}ck(g);Y(g|0);return null;}function gm(i){var k=null,g=null;g=new MessageChannel();g.port1;k=g.port2;dU(aX,((i|0)|0),g);n7(i|0);g={a0:null,a1:0};g.a0=k;g.a1=(i|0);k.onmessage=nq(g);}function ns(k,i,g){k.set(i,g);}function dU(k,i,g){k.set(i,g);}function nq(i){var g=null,k=null;g={a0:null,a1:null,a2:null};np(g,i);k=dT(g);dS(g);return k;}function np(i,g){nl(i,g);}function dT(i){var g=null;if(i.a1!==null){g=[{a0:null,a1:null}];g[0].a0=i.a1;g[0].a1=i.a2;g=sv(nn,g[0]);gv(i.a0,g);i.a1=null;}return i.a0;}function dS(g){var i=null;i=g.a1;if(i!==null)i(g.a2);}function nn(g){g.a0(g.a1);}function nl(i,g){nk(i,g);}function nk(k,i){var g=null,m=null;g=[{a0:null,a1:0}];g[0].a0=i.a0;g[0].a1=(i.a1|0);m=sv(ni,g[0]);k.a0=m;k.a1=null;k.a2=g[0];}function ni(i,g){ng(i,g);}function ng(q,o){var m=null,v=null,i=0,t=null,u=0,k=null,l=0,g=0;m=cf();k=-16+m|0;aZ(k);v=o.data;if(v!==null){i=k|0;gj(i,~~ +v.length);if( +v.length>0){g=0;while(1){k=gi(v,g);l=oSlot;t=a;u=gh(i,g)|0;t[u]=k[l]|0;g=g+1|0;if( +v.length>(+(g|0)))continue;break;}}kU(q.a1|0,i);gg(i);}else{dN(q.a1|0);q.a0.onmessage=null;}aZ(m);}function gi(i,g){oSlot=0+g|0;return i;}function lZ(o,m,k,i){var v=0,t=null,g=null,q=null;v=cT(k)|0;gm(m|0);t=b4(aX,((o|0)|0)).port2;g=b4(aX,((m|0)|0)).port1;q={addr: v, port: i, arg1: g};t.postMessage(q,new Array(g));}function r2(o){var g=0,m=null,k=null,i=null;g=aD(88)|0;eF(g);if(((ez(g,o)|0)&255)===0)if(((mK(g)|0)&255)===0){i=new MessageChannel();m=i.port1;k=i.port2;dU(aX,(g|0),i);jN(g);i={a0:0};i.a0=g;k.onmessage=pi(i);return m;}ck(g);Y(g|0);return null;}function pi(i){var g=null,k=null;g={a0:null,a1:null,a2:null};ph(g,i);k=dT(g);dS(g);return k;}function ph(i,g){pg(i,g);}function pg(i,g){pf(i,g);}function pf(k,i){var g=null,m=null;g=[{a0:0}];g[0].a0=(i.a0|0);m=sv(pd,g[0]);k.a0=m;k.a1=null;k.a2=g[0];}function pd(i,g){pb(i);}function pb(g){dN(g.a0|0);}function pa(o,m,n,k,i,g){var t=0,q=null;t=cT(i)|0;q=b4(aX,((o|0)|0)).port2;q.postMessage({addr: t, port: g, data: cY(m,n,k)});}function rT(o){var g=0,m=null,k=null,i=null;g=aD(32)|0;mA(g);if(((mr(g,o)|0)&255)!==0){ml(g);Y(g|0);return null;}i=new MessageChannel();m=i.port1;k=i.port2;dU(aX,(g|0),i);o$(g);i={a0:0};i.a0=g;k.onmessage=i0(i);return m;}function i0(i){var g=null,k=null;g={a0:null,a1:null,a2:null};iZ(g,i);k=dT(g);dS(g);return k;}function iZ(i,g){iY(i,g);}function iY(i,g){iX(i,g);}function iX(k,i){var g=null,m=null;g=[{a0:0}];g[0].a0=(i.a0|0);m=sv(iV,g[0]);k.a0=m;k.a1=null;k.a2=g[0];}function iV(i,g){iT(i,g);}function iT(t,q){var o=null,A=null,k=null,i=0,x=null,y=0,v=0,m=null,n=0,g=0;o=cf();m=-16+o|0;aZ(m);A=q.data;if(A!==null){k=A.data;i=m|0;gj(i,~~ +k.length);if( +k.length>0){g=0;while(1){m=gi(k,g);n=oSlot;x=a;y=gh(i,g)|0;x[y]=m[n]|0;g=g+1|0;if( +k.length>(+(g|0)))continue;break;}}g=A.addr;v=A.port;i3(t.a0|0,i,g,v);gg(i);}else mm(t.a0|0);aZ(o);}function k7(i){var m=null,k=null,g=null;g=[0];g[0]=(1048616|0);m=[0];m[0]=((60|0)|0);k=[nullObj];k[0]={d:null,o:i};g=k5(k,0,g,0,m,0);ip(g);;}function k5(t,u,q,r,o,p){var v=0,k=0,i=null,g=0,m=null;k=d5|0;a:{b:{if((k|0)>1){i=cX;g=1;while(1){if((i[g]&255)!==0){g=g+1|0;if((g|0)===(k|0))break b;continue;}break;}}else{g=1;}if((g|0)!==(k|0)){k=g;break a;}}d5=k<<1;i=d6;g=se(k,88)|0;if(i!==nullArray||0!==0)i=rQ(i,i.length,g/44|0);else i=rP(g/44|0);d6=i;g=d5|0;i=cX;if(i!==nullArray||0!==0)i=(function(){var __old__=i;var __ret__=new Uint8Array(g/1|0);__ret__.set(__old__.subarray(0, Math.min(__ret__.length,__old__.length)));return __ret__;})();else i=new Uint8Array(g/1|0);cX=i;}i=d6;m=t[u];g=q[r]|0;v=o[p]|0;i[k].a1=m.d[m.o];i[k].a2=null;i[k].a3=g;i[k].a4=null;i[k].i5=v;i[k].i6=1;i[k].i7=0;i[k].a9=null;i[k].a10=null;m=cX;m[k]=1;return i[k];}function ip(k){var m=0,i=null,g=null,h=0;m=k.a3|0;h=c[4+m>>2];g=a;g=cj(g,h);i=new CheerpException(g);k.a0=i;throw i;;}function cj(i,j){var g=null,m=0,k=null;g=String();if((i[j]&255)===0)return String(g);m=0;while(1){k=String.fromCharCode(i[j+m|0]<<24>>24);g=g.concat(k);m=m+1|0;if((i[j+m|0]&255)!==0)continue;break;}return String(g);}function ie(i){var m=null,k=null,g=0;m=[0];m[0]=i;id(cj(a,1052384>>0),m,0);g=bg()|0;if((g|0)!=(1049344|0))while(1){k=cj(a,1052376>>0);m[0]=(g|0);ic(k,m,0,c,g>>2);g=c[4+g>>2]|0;if((g|0)!=(1049344|0))continue;break;}}function id(i,g,h){console.log(i,String(g[h]|0));}function ic(k,i,j,g,h){var o=null,m=null;o=String(i[j]|0);m=cj(a,1052368>>0);console.log(k,o,m,String(g[h]|0));}function h2(m,n,k){var g=null,i=0;g=h1(m,n,k);i=(g.length)-1|0;if(((g.charCodeAt(i))|0)===10){console.log(g.substr(0,i));return;}console.log(g);}function h1(v,w,t){var k=0,i=null,o=0,q=0,m=0,g=0;i=String();if((t|0)===0)return i;q=t;o=0;while(1){k=v[w+o|0]|0;if((k&255)!==0){g=k&255;if(k<<24<=-16777216)if((k&255)<192){g=(g&63)+(m<<6)|0;}else if((k&255)<224){g&=31;}else if((k&255)<240){g&=15;}else{g&=7;}q=q-1|0;o=o+1|0;a:{if((q|0)!==0)if((v[w+o|0]&192)===128){m=g;break a;}if(g>>>0<65536){m=g;}else{m=g-65536|0;i=i.concat(String.fromCharCode((m>>>10)+55296|0));g=(g&1023)+56320|0;}i=i.concat(String.fromCharCode(g));}if((q|0)!==0)continue;return i;}break;}return i;}function jq(){ru();ox();ow();}function nW(o,m,k,i,g){pa(o|0,a,m>>0,k,i,g);}function hJ(i,g){h2(a,i>>0,g);}function hK(k,i,g){n$(k|0,a,i>>0,g);}function hQ(i,g){pN(a,i>>0,g);}var eb=null;var aX=null;var eh=null;var g8=null;var d5=16;var pp=new Uint8Array(16);var cX=pp;var pq=rP(16);var d6=pq;function rM(){this.a0=null;this.a1=null;this.a2=null;this.a3=0;this.a4=null;this.i5=0;this.i6=0;this.i7=0;this.a8=null;this.a9=null;this.a10=null;}function rP(e){var r=[];for(var i=0;i>16;try{__asm.sF.grow(pages);__heap=__asm.sF.buffer;sA(__heap);return pages<<16;}catch(e){return -1;}}var IpStack={bind:null,connect:null,down:null,init:null,input:null,listen:null,output:null,parseIP:null,up:null,};var a=null,c=null,__asm=null,__heap=null;function sB(){throw new Error('this should be unreachable');};var ru=null;var aD=null;var mA=null;var mr=null;var ml=null;var o$=null;var mm=null;var gj=null;var gh=null;var i3=null;var gg=null;var cT=null;var bg=null;var eF=null;var ez=null;var mK=null;var jN=null;var ck=null;var dN=null;var n7=null;var kU=null;var kQ=null;var iI=null;var cC=null;var od=null;var qn=null;var b6=null;var ak=null;var oa=null;var m5=null;var m3=null;var mY=null;var nJ=null;var mX=null;var nN=null;var iP=null;var iN=null;var lx=null;var Y=null;var cf=null;var aZ=null;export default function(g){return (g&&g.buffer)?Promise.resolve(g.buffer):sE((g&&g.absPath)?g.absPath:new URL('ipstack.wasm', import.meta.url)).then(g=>WebAssembly.instantiate(g,{i:{bD:sB,lh:sB,fy:sB,lf:sB,le:sB,aq:sB,hQ:hQ,ie:ie,lw:sB,hK:hK,lv:sB,lZ:lZ,hJ:hJ,kT:kT,d8:d8,k7:k7,pH:pH,nW:nW,sz:sz,}})).then(g=>{__asm=g.instance.exports;__heap=__asm.sF.buffer;sA(__heap);ru=__asm.ru;aD=__asm.aD;mA=__asm.mA;mr=__asm.mr;ml=__asm.ml;o$=__asm.o$;mm=__asm.mm;gj=__asm.gj;gh=__asm.gh;i3=__asm.i3;gg=__asm.gg;cT=__asm.cT;bg=__asm.bg;eF=__asm.eF;ez=__asm.ez;mK=__asm.mK;jN=__asm.jN;ck=__asm.ck;dN=__asm.dN;n7=__asm.n7;kU=__asm.kU;kQ=__asm.kQ;iI=__asm.iI;cC=__asm.cC;od=__asm.od;qn=__asm.qn;b6=__asm.b6;ak=__asm.ak;oa=__asm.oa;m5=__asm.m5;m3=__asm.m3;mY=__asm.mY;nJ=__asm.nJ;mX=__asm.mX;nN=__asm.nN;iP=__asm.iP;iN=__asm.iN;lx=__asm.lx;Y=__asm.Y;cf=__asm.cf;aZ=__asm.aZ;IpStack.bind=function(a0){return rT(a0);};IpStack.connect=function(a0,a1,a2){return rZ(a0,a1,a2);};IpStack.down=function(){return r4();};IpStack.init=function(a0){return rY(a0);};IpStack.input=function(a0){return r3(a0);};IpStack.listen=function(a0){return r2(a0);};IpStack.output=function(a0){return r1(a0);};IpStack.parseIP=function(a0){return r0(a0);};IpStack.up=function(a0){return rX(a0);};jq();return{IpStack:IpStack,};});}function sA(g){a=new Uint8Array(g);c=new Int32Array(g);} \ No newline at end of file diff --git a/tun/ipstack.wasm b/tun/ipstack.wasm index cb516e4..732fd44 100644 Binary files a/tun/ipstack.wasm and b/tun/ipstack.wasm differ