Commit f0792a08 authored by wang's avatar wang

111

parent bc2a2ceb
import log4js from 'log4js' import log4js from 'log4js'
import {genUuid, ie, randint} from "./utils.js" import {bl, genUuid, ht, ie, Ol, randint, se} from "./utils.js"
import axios from "axios"; import axios from "axios";
import {PxEnv} from './px.js' import {PxEnv} from './px.js'
import * as fs from "fs"; import * as fs from "fs";
...@@ -38,8 +38,8 @@ class PxBypass { ...@@ -38,8 +38,8 @@ class PxBypass {
prox = `http://user-uni001-region-us-sessid-${randint(1000, 5000)}-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600` prox = `http://user-uni001-region-us-sessid-${randint(1000, 5000)}-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600`
// prox = `http://uni00001_custom_zone_US_sid_${randint(67336718, 67336728)}_time_5:q39CEBTs5A@us.foxyip.com:7778` // prox = `http://uni00001_custom_zone_US_sid_${randint(67336718, 67336728)}_time_5:q39CEBTs5A@us.foxyip.com:7778`
// prox = `http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:${randint(10000, 13500)}` // prox = `http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:${randint(10000, 13500)}`
prox = 'http://127.0.0.1:8890' // prox = 'http://127.0.0.1:9000'
tlsUrl = 'http://127.0.0.1:58000/tls/forward' // tlsUrl = 'http://127.0.0.1:58000/tls/forward'
constructor() { constructor() {
this.log = log4js.getLogger('px') this.log = log4js.getLogger('px')
...@@ -143,8 +143,7 @@ class PxBypass { ...@@ -143,8 +143,7 @@ class PxBypass {
// body = this.updateBody(body); // body = this.updateBody(body);
let body = getPayload(this.uuid, this.vid, this.sid, this.px755, this.ts, this.cts, data, undefined, this.appId, this.tag, this.ft) let body = this.getPayload(data)
// this.log.info(body)
body.push(`seq=${this.seq}`) body.push(`seq=${this.seq}`)
body.push(`rsc=${this.rsc}`) body.push(`rsc=${this.rsc}`)
let res = await axios.post(this.tlsUrl, JSON.stringify({ let res = await axios.post(this.tlsUrl, JSON.stringify({
...@@ -183,7 +182,49 @@ class PxBypass { ...@@ -183,7 +182,49 @@ class PxBypass {
} }
return body return body
} }
getPayload(data) {
let vh = null;
// console.log('now', le(), JSON.stringify(t))
console.log('now', JSON.stringify(data))
// var A = $u();
let uuid = this.uuid
var pc = se(ht(data), function (t, e) {
return [uuid, t, e]['join'](":");
}(this.tag, this.ft));
var b = {
"vid": this.vid,
"tag": this.tag,
"appID": this.appId,
"cu": this.uuid,
"cs": this.cs,
"pc": pc
};
var w = bl(data, b, this.ts);
// console.log("ts", fl())
// console.log('res', w)
var E = ["payload=" + w, "appId=" + this.appId, "tag=" + this.tag, "uuid=" + this.uuid, "ft=" + this.ft, "en=" + "NTA"];
var T = null;
T && E["push"]('xuuid=' + T);
this.cs && E["push"]('cs=' + this.cs);
pc && E["push"]('pc=' + pc);
var O = this.sid;
var U = Ol(this.ts);
(O || U) && E["push"]('sid=' + (O || this.sid) + U);
var I = [];
this.vid && E["push"]('vid=' + this.vid);
// mu && E["push"]('jcs=' + mu);
var S = this.ci;
S && E["push"]('ci=' + S);
// Ru || (Ru = Df(cu));
var C = this.pxhd;
C && E["push"]('pxhd=' + C);
let Qf = this.cts;
Qf && E["push"]('cts=' + Qf);
I["length"] >= 0 && E["push"]["apply"](E, I);
return E;
}
parseRes(inRes) { parseRes(inRes) {
if (inRes['ob']) { if (inRes['ob']) {
let cks = ie(atob(inRes.ob), this.version()).split('~~~~') let cks = ie(atob(inRes.ob), this.version()).split('~~~~')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment