403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/call/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/call/logger.min.js
(function(){BX.namespace("BX.Call");BX.Call.Logger=function(e,t){this.serviceUrl=e;this.token=t;this.socket=null;this.attempt=0;this.reconnectTimeout=null;this.unsentMessages=[];this.onSocketOpenHandler=this.onSocketOpen.bind(this);this.onSocketCloseHandler=this.onSocketClose.bind(this);this.onSocketErrorHandler=this.onSocketError.bind(this);Object.defineProperty(this,"isConnected",{get:function(){return this.socket&&this.socket.readyState===1}});this.connect()};BX.Call.Logger.prototype={log:function(e){if(typeof e!="string"){console.error("Message should be string");return}if(this.isConnected){this.socket.send(JSON.stringify({action:"log",message:e}))}else{this.unsentMessages.push(e)}},sendStat:function(e){if(typeof e=="object"){e=JSON.stringify(e)}if(this.isConnected){this.socket.send(JSON.stringify({action:"stat",message:e}))}},connect:function(){if(this.socket){return}if(!this.serviceUrl){console.error("Logging service url is empty");return}if(!this.serviceUrl.startsWith("ws://")&&!this.serviceUrl.startsWith("wss://")){console.error("Logging service url should start with ws:// or wss://");return}if(!this.token){console.eror("Logging token is empty");return}this.attempt++;this.socket=new WebSocket(this.serviceUrl+"?token="+this.token);this.bindSocketEvents()},scheduleReconnect:function(){clearTimeout(this.reconnectTimeout);if(this.attempt>3){console.error("Could not connect to the logging service, giving up");return}this.reconnectTimeout=setTimeout(this.connect.bind(this),this.getConnectionDelay(this.attempt)*1e3)},getConnectionDelay:function(e){switch(e){case 0:case 1:return 15;case 2:return 30;default:return 60}},disconnect:function(){clearTimeout(this.reconnectTimeout);if(this.socket){this.removeSocketEvents();this.socket.close(1e3);this.socket=null}},bindSocketEvents:function(){this.socket.addEventListener("open",this.onSocketOpenHandler);this.socket.addEventListener("close",this.onSocketCloseHandler);this.socket.addEventListener("error",this.onSocketErrorHandler)},removeSocketEvents:function(){this.socket.removeEventListener("open",this.onSocketOpenHandler);this.socket.removeEventListener("close",this.onSocketCloseHandler);this.socket.removeEventListener("error",this.onSocketErrorHandler)},onSocketOpen:function(){this.attempt=0;for(var e=0;e<this.unsentMessages.length;e++){this.socket.send(JSON.stringify({action:"log",message:this.unsentMessages[e]}))}this.unsentMessages=[]},onSocketClose:function(){this.socket=null;this.scheduleReconnect()},onSocketError:function(){this.socket=null;this.scheduleReconnect()},destroy:function(){this.disconnect();this.unsentMessages=null}}})();
//# sourceMappingURL=logger.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit