From 48d652e768bb1575f265e9364ee7d34174684199 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Fri, 5 Jul 2019 14:17:05 -0700 Subject: [PATCH] Fixed for IE11 in amt-redir-ws.js --- public/commander.htm | 2 +- public/scripts/amt-redir-ws-0.1.0.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/commander.htm b/public/commander.htm index 6d2acb1b..391547f0 100644 --- a/public/commander.htm +++ b/public/commander.htm @@ -54,7 +54,7 @@ p.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);p.PerformNextAjax()}};p.PerformAjaxEx= p.PendingAjax.shift();b[1](null,a,b[2])}null!=p.websocket&&(p.websocket.close(),p.websocket=null,p.socketState=0)};return p},CreateAmtRedirect=function(b){var c={};c.m=b;b.parent=c;c.State=0;c.socket=null;c.host=null;c.port=0;c.user=null;c.pass=null;c.authuri="/RedirectionService";c.tlsv1only=0;c.connectstate=0;c.protocol=b.protocol;c.amtaccumulator="";c.amtsequence=1;c.amtkeepalivetimer=null;c.digestRealmMatch=null;c.onStateChanged=null;c.Start=function(a,b,d,n,e){c.host=a;c.port=b;c.user=d;c.pass= n;c.connectstate=0;c.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+e+("*"==d?"&serverauth=1":"")+("undefined"===typeof n?"&serverauth=1&user="+d:"")+"&tls1only="+c.tlsv1only);c.socket.onopen=c.xxOnSocketConnected;c.socket.onmessage=c.xxOnMessage;c.socket.onclose=c.xxOnSocketClosed;c.xxStateChange(1)};c.xxOnSocketConnected=function(){urlvars&& urlvars.redirtrace&&console.log("REDIR-CONNECT");c.xxStateChange(2);1==c.protocol&&c.xxSend(c.RedirectStartSol);2==c.protocol&&c.xxSend(c.RedirectStartKvm);3==c.protocol&&c.xxSend(c.RedirectStartIder)};var a=new FileReader,d=!1,e=[];a.readAsBinaryString?a.onload=function(b){c.xxOnSocketData(b.target.result);0==e.length?d=!1:a.readAsBinaryString(new Blob([e.shift()]))}:a.readAsArrayBuffer&&(a.onloadend=function(b){c.xxOnSocketData(b.target.result);0==e.length?d=!1:a.readAsArrayBuffer(e.shift())}); -c.xxOnMessage=function(b){c.inDataCount++;if("object"==typeof b.data)if(1==d)e.push(b.data);else if(a.readAsBinaryString)d=!0,a.readAsBinaryString(new Blob([b.data]));else if(f.readAsArrayBuffer)d=!0,a.readAsArrayBuffer(b.data);else{var l="";b=new Uint8Array(b.data);for(var u=b.byteLength,n=0;nc.amtaccumulator.length)return;switch(c.amtaccumulator.charCodeAt(1)){case 0:if(13>c.amtaccumulator.length)return;b= c.amtaccumulator.charCodeAt(12);if(c.amtaccumulator.length<13+b)return;c.xxSend(String.fromCharCode(19,0,0,0,0,0,0,0,0));a=13+b;break;default:c.Stop()}break;case 20:if(9>c.amtaccumulator.length)return;var e=ReadIntX(c.amtaccumulator,5);if(c.amtaccumulator.length<9+e)return;var n=c.amtaccumulator.charCodeAt(1),b=c.amtaccumulator.charCodeAt(4),x=[];for(a=0;a