Commit c346e22d authored by wang's avatar wang

收集环境

parent 6acd511d
...@@ -6,8 +6,15 @@ import {MongoClient} from "mongodb"; ...@@ -6,8 +6,15 @@ import {MongoClient} from "mongodb";
import * as fs from "fs"; import * as fs from "fs";
let ENVS = JSON.parse(fs.readFileSync('./env.json', 'utf-8').toString()) let ENVS = JSON.parse(fs.readFileSync('./env.json', 'utf-8').toString())
let keys = Object.keys(ENVS); let keys = Object.keys(ENVS);
const uri = "mongodb://lcc-spider:JIUsfhiad&^@54.183.159.9:27017/?authSource=admin&directConnection=true";
// const client = new MongoClient(uri); const plt = process.platform;
let uri;
if (plt !== 'darwin') {
uri = "mongodb://lcc-spider:JIUsfhiad&^@54.183.159.9:27017/?authSource=admin&directConnection=true";
}else{
uri = 'mongodb://root:123456@192.168.50.110:27017/'
}// const client = new MongoClient(uri);
log4js.levels.INFO.colour = 'white'; log4js.levels.INFO.colour = 'white';
// console.log(log4js.levels.INFO.colour); // console.log(log4js.levels.INFO.colour);
log4js.configure({ log4js.configure({
...@@ -57,8 +64,8 @@ class PxBypass { ...@@ -57,8 +64,8 @@ class PxBypass {
// 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)}`
this.prox = 'http://127.0.0.1:8890' this.prox = 'http://127.0.0.1:8890'
// this.tlsUrl = 'http://52.52.23.116/tls/forward' this.tlsUrl = 'http://52.52.23.116/tls/forward'
this.tlsUrl = 'http://127.0.0.1:58000/tls/forward' // this.tlsUrl = 'http://127.0.0.1:58000/tls/forward'
this.pxHeaders = { this.pxHeaders = {
...@@ -118,7 +125,7 @@ class PxBypass { ...@@ -118,7 +125,7 @@ class PxBypass {
let proxyRes = await axios({ let proxyRes = await axios({
method: 'post', method: 'post',
url: 'http://ymx-lcc.unififi.com/proxy/get-proxy', url: 'http://aws-lcc.unififi.com/proxy/get-proxy',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
...@@ -144,7 +151,7 @@ class PxBypass { ...@@ -144,7 +151,7 @@ class PxBypass {
"accept-language": "en-US", "accept-language": "en-US",
"cache-control": "no-cache", "cache-control": "no-cache",
"content-type": "application/json", "content-type": "application/json",
"ocp-apim-subscription-key": "dc6844776fe84b1c8b68affe7deb7916", "ocp-apim-subscription-key": "3b6a6994753b4efc86376552e52b8432",
"origin": "https://www.spirit.com", "origin": "https://www.spirit.com",
"pragma": "no-cache", "pragma": "no-cache",
"referer": "https://www.spirit.com/", "referer": "https://www.spirit.com/",
...@@ -152,7 +159,7 @@ class PxBypass { ...@@ -152,7 +159,7 @@ class PxBypass {
'Authorization': 'Bearer ' + token, 'Authorization': 'Bearer ' + token,
"cookie": cks "cookie": cks
} }
let res = await axios.post('http://ymx-lcc.unififi.com/header/add', JSON.stringify({ let res = await axios.post('http://aws-lcc.unififi.com/header/add', JSON.stringify({
'brush_fromto': 'LAS-BOS', 'brush_fromto': 'LAS-BOS',
'brush_fromdate': '2023-05-26', 'brush_fromdate': '2023-05-26',
'brush_header': headers, 'brush_header': headers,
...@@ -391,7 +398,7 @@ class PxBypass { ...@@ -391,7 +398,7 @@ class PxBypass {
let res = await this.do_collector(data) let res = await this.do_collector(data)
this.seq++; this.seq++;
this.pxenv = new PxEnv(this.env, this.url, this.sid, this.vid, this.ts, this.num1, this.num2, this.pxenv = new PxEnv(undefined, this.env, this.url, this.sid, this.vid, this.ts, this.num1, this.num2,
this.str1, this.uuid, this.str1, this.uuid,
this.startTs, this.startTs2, this.performanceNow, this.px12280) this.startTs, this.startTs2, this.performanceNow, this.px12280)
...@@ -455,7 +462,7 @@ class PxBypass { ...@@ -455,7 +462,7 @@ class PxBypass {
"accept-language": "en", "accept-language": "en",
"cache-control": "no-cache", "cache-control": "no-cache",
"content-type": "application/json", "content-type": "application/json",
"ocp-apim-subscription-key": "dc6844776fe84b1c8b68affe7deb7916", "ocp-apim-subscription-key": "3b6a6994753b4efc86376552e52b8432",
"origin": "https://www.spirit.com", "origin": "https://www.spirit.com",
"pragma": "no-cache", "pragma": "no-cache",
"referer": "https://www.spirit.com/", "referer": "https://www.spirit.com/",
...@@ -505,7 +512,7 @@ class PxBypass { ...@@ -505,7 +512,7 @@ class PxBypass {
async function run() { async function run() {
while (true) { while (true) {
try { try {
// let res = await axios.get('http://ymx-lcc.unififi.com/header/task/pull/cookieF9?brush_name=test') // let res = await axios.get('http://aws-lcc.unififi.com/header/task/pull/cookieF9?brush_name=test')
// let data = res.data; // let data = res.data;
let data = { let data = {
......
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