prepare more P2P pathing

merge-requests/180/head
Moe 2020-04-05 16:14:31 -07:00
parent 0dc4b7afd2
commit 8252886272
3 changed files with 19 additions and 6 deletions

View File

@ -301,6 +301,7 @@ $.ccio.globalWebsocket=function(d,user){
uid: user.uid,
ke: d.ke,
id: d.id,
subscriptionId: subscriptionId,
// channel: channel
})
if(!$.ccio.mon[d.ke+d.id+user.auth_token].ctx||$.ccio.mon[d.ke+d.id+user.auth_token].ctx.length===0){

View File

@ -102,9 +102,15 @@
<script><% include ../libs/js/bootstrap-table.min.js %></script>
<script>
$.ccio={subs:{}};$.ls=localStorage;
$.ccio.ws=io(location.origin,{
path : tool.checkCorrectPathEnding(location.pathname)+'socket.io'
});
if(location.search === '?assemble=1'){
$.ccio.ws=io(location.origin,{
path : '/socket.io'
});
}else{
$.ccio.ws=io(location.origin,{
path : tool.checkCorrectPathEnding(location.pathname)+'socket.io'
});
}
$.ccio.cx=function(x){if(!x.ke){x.ke=$user.ke;};if(!x.uid){x.uid=$user.uid;};return $.ccio.ws.emit('a',x)}
$.ccio.ws.on('connect',function(d){
$.ccio.cx({f:'init',auth:$user.auth_token});

View File

@ -229,9 +229,15 @@ switch($user.lang){
})
break;
}
$.ccio.ws=io(location.origin,{
path : tool.checkCorrectPathEnding(location.pathname)+'socket.io'
});
if(location.search === '?assemble=1'){
$.ccio.ws=io(location.origin,{
path : '/socket.io'
});
}else{
$.ccio.ws=io(location.origin,{
path : tool.checkCorrectPathEnding(location.pathname)+'socket.io'
});
}
$.ccio.cx=function(x){return $.ccio.ws.emit('super',x)}
$.ccio.ws.on('connect',function(d){
$.ccio.cx({f:'init',mail:$user.mail,pass:$user.pass})