Created
June 28, 2012 14:33
1PW unminified
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
else { | |
E += 1; | |
E >= D.length && (E = 0, 6E4 > i && (i += 2E3)); | |
var b = "ws://127.0.0.1:" + D[E] + "/2"; | |
F && (F.close(), F = k); | |
H = K = m; | |
ka = -1; | |
try { | |
(F = new WebSocket(b)) ? (F.onerror = function (b) { | |
console.error("[AGENT] socket error: " + b + "; readyState=" + this.readyState + ". Perhaps Helper is not running on " + this.url + " or is shutting down?"); | |
a() | |
}, F.onopen = function () { | |
console.log("[AGENT] connected to port " + D[E]); | |
P.aa().e || (U = f); | |
j() | |
}, F.onmessage = function (b) { | |
if (!b || !b.data) console.error("[AGENT] Invalid message."); | |
else { | |
try { | |
if (b.data.length > 7 && b.data.substr(0, 7) === "U2FsdGV") { | |
var c = J.I(ja, b.data), | |
d = sjcl.codec.utf8String.fromBits(c), | |
i = JSON.parse(d); | |
i ? h(i) : console.error("[AGENT] Failed to parse incoming message") | |
} else if (b.data.length > 2) { | |
var e = J.s("U2FsdGV" + b.data); | |
if (e && e.length > 2 && e.substr(0, 1) === "{") { | |
var x = JSON.parse(e), | |
b = m; | |
if (x.action === "auth") { | |
var g = x.payload || {}; | |
o = g.capabilities || {}; | |
var ya = g.key || x.key; | |
if (ya) { | |
la = J.T(ya); | |
P.Bb({ | |
e: la | |
}); | |
T ? b = P.Q(T) : Q.n() && (b = P.Q(T)) | |
} | |
} | |
b && j() | |
} | |
} | |
} catch (ca) { | |
console.error("[AGENT] Exception in onmessage: " + ca) | |
} | |
a() | |
} | |
}, F.onclose = function (b) { | |
console.log("[AGENT] close: " + b); | |
l(m); | |
N = k; | |
a(); | |
g(E == D.length - 1 ? i : 50) | |
}) : (console.error("[AGENT] Failed to connect to " + D[E]), g(E == D.length - 1 ? i : 50)) | |
} catch (c) { | |
console.error("[AGENT] Exception caught when connecting to helper: " + c.name + " - " + c.message), F || (console.error("[AGENT] Could not connect on port " + D[E] + "; trying again on next port."), g(E == D.length - 1 ? i : 50)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment