Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
899f554336 | ||
|
|
7b5c3717ba | ||
|
|
38d369bb58 | ||
|
|
0ea415ae78 | ||
|
|
5c6dc47d47 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
*.crx
|
*.crx
|
||||||
*.log
|
*.log
|
||||||
|
build
|
||||||
|
|||||||
7
build.sh
Normal file → Executable file
7
build.sh
Normal file → Executable file
@@ -1 +1,6 @@
|
|||||||
google-chrome --pack-extension=./chromeproxy --pack-extension-key=./chromeproxy.pem
|
rm build/ -rf
|
||||||
|
mkdir -p ./build
|
||||||
|
cd proxyserver && go build && mv proxyserver ../build/ && cd ..
|
||||||
|
cp start.sh build/start.sh
|
||||||
|
cp stop.sh build/stop.sh
|
||||||
|
cp proxyserver/config.yaml build/config.yaml
|
||||||
|
|||||||
2
build_crx.sh
Executable file
2
build_crx.sh
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
google-chrome --pack-extension=./chromeproxy --pack-extension-key=./chromeproxy.pem
|
||||||
1
chromeproxy/.vscode/launch.json
vendored
1
chromeproxy/.vscode/launch.json
vendored
@@ -14,6 +14,7 @@
|
|||||||
"--ignore-certificate-errors",
|
"--ignore-certificate-errors",
|
||||||
"--disable-dev-shm-usage",
|
"--disable-dev-shm-usage",
|
||||||
"--mute-audio",
|
"--mute-audio",
|
||||||
|
"--single-process",
|
||||||
"--safebrowsing-disable-auto-update",
|
"--safebrowsing-disable-auto-update",
|
||||||
"--disable-gpu",
|
"--disable-gpu",
|
||||||
"--no-sandbox",
|
"--no-sandbox",
|
||||||
|
|||||||
42
chromeproxy/background/capture.js
Normal file
42
chromeproxy/background/capture.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
var href = window.location.href;
|
||||||
|
var content = document.documentElement.innerHTML;
|
||||||
|
|
||||||
|
try {
|
||||||
|
if(waittime === undefined) {
|
||||||
|
waittime = 6000
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
waittime = 6000
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (condition == undefined) {
|
||||||
|
condition = function () {
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (condition()) {
|
||||||
|
Tell(BackgroundMsgType.CONTENT, content);
|
||||||
|
} else {
|
||||||
|
setTimeout(function () {
|
||||||
|
if (condition()) {
|
||||||
|
Tell(BackgroundMsgType.CONTENT, content);
|
||||||
|
} else {
|
||||||
|
Tell(BackgroundMsgType.NOTWANT, content);
|
||||||
|
}
|
||||||
|
}, waittime)
|
||||||
|
}
|
||||||
|
|
||||||
|
function Tell(backgroundType, content) {
|
||||||
|
try {
|
||||||
|
if (content == undefined) {
|
||||||
|
chrome.runtime.sendMessage({ type: backgroundType });
|
||||||
|
} else {
|
||||||
|
chrome.runtime.sendMessage({ type: backgroundType, content: content });
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
window.location.href = Host;
|
||||||
|
}
|
||||||
|
}
|
||||||
23
chromeproxy/background/config.js
Normal file
23
chromeproxy/background/config.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
// 配置使用的监听
|
||||||
|
chrome.webRequest.onBeforeRequest.addListener(function (details) {
|
||||||
|
if (details.url.startsWith("http://eson.config")) {
|
||||||
|
var params = new URL(details.url).searchParams;
|
||||||
|
UpdateHost(params.get("taskurl"))
|
||||||
|
chrome.tabs.remove(details.tabId);
|
||||||
|
chrome.tabs.query({ currentWindow: true }, function (tabs) {
|
||||||
|
var count = 0
|
||||||
|
for (var tab of tabs) {
|
||||||
|
if (!tab.url.startsWith("chrome://")) {
|
||||||
|
count++;
|
||||||
|
chrome.tabs.executeScript(tab.id, { runAt: "document_end", code: `window.location.href = "${Host}"` })
|
||||||
|
} else {
|
||||||
|
chrome.tabs.remove(tab.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var i = count; i < WorkerNumber; i++) {
|
||||||
|
chrome.tabs.create({ url: `${Host}` });
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return { cancel: true };
|
||||||
|
}
|
||||||
|
}, { 'urls': ["<all_urls>"] }, ['blocking']);
|
||||||
@@ -1,51 +1,97 @@
|
|||||||
|
console.log("background");
|
||||||
|
|
||||||
var task_manager = {
|
var task_manager = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
|
||||||
|
sendResponse({});
|
||||||
|
switch (request.type) {
|
||||||
|
case BackgroundMsgType.CONTENT:
|
||||||
|
FinishTask(sender, request.content);
|
||||||
|
break;
|
||||||
|
case BackgroundMsgType.ERROR:
|
||||||
|
ErrorTask(sender, request.error)
|
||||||
|
break;
|
||||||
|
case BackgroundMsgType.GETTASK:
|
||||||
|
GetTask(sender);
|
||||||
|
break;
|
||||||
|
case BackgroundMsgType.NOTWANT:
|
||||||
|
|
||||||
|
task = task_manager[sender.tab.id];
|
||||||
|
task.data.retry --;
|
||||||
|
if(task.data.retry >= 0) {
|
||||||
|
CaptureContent(task);
|
||||||
|
} else {
|
||||||
|
ErrorTask(sender, request.content);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function GetTask(sender) {
|
function GetTask(sender) {
|
||||||
fetch(GetTaskUrl).then(function (response) {
|
fetch(GetTaskUrl).then(function (response) {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
response.json().then(function (task) {
|
response.json().then(function (task) {
|
||||||
if(task.code == 200) {
|
|
||||||
task_manager[sender.tab.id] = task;
|
CaptureContent(task);
|
||||||
chrome.tabs.executeScript(sender.tab.id, {runAt: "document_end", code: `window.location.href = "${task.data.url}"` }, function (results) {
|
|
||||||
})
|
|
||||||
Tell(sender, InjectMsgType.FETCH);
|
|
||||||
} else {
|
|
||||||
Tell(sender, InjectMsgType.NOTASK);
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// ErrorTask(sender, "error response:" + response.text())
|
console.log("error response:", response.text())
|
||||||
console.log("error response:",response.text())
|
ErrorTask(sender, response.text());
|
||||||
}
|
}
|
||||||
}).catch(function (reason) {
|
}).catch(function (reason) {
|
||||||
console.log(reason);
|
console.log(reason);
|
||||||
// GetTask();
|
ErrorTask(sender, reason);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function CaptureContent(task) {
|
||||||
|
if (task.code == 200) {
|
||||||
|
|
||||||
|
if(task.data.retry == undefined) {
|
||||||
|
task.data.retry = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
chrome.tabs.create({ url: task.data.url }, function (tab) {
|
||||||
|
task_manager[tab.id] = task;
|
||||||
|
if (task.data.content_condition) {
|
||||||
|
condition = `${task.data.content_condition}`
|
||||||
|
}
|
||||||
|
if (condition) {
|
||||||
|
chrome.tabs.executeScript(tab.id, { runAt: "document_end", code: condition }, function () {
|
||||||
|
chrome.tabs.executeScript(tab.id, { runAt: "document_end", file: "background/capture.js" });
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
chrome.tabs.executeScript(tab.id, { runAt: "document_end", file: "background/capture.js" });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function FinishTask(sender, content) {
|
function FinishTask(sender, content) {
|
||||||
var task = task_manager[sender.tab.id];
|
var task = task_manager[sender.tab.id];
|
||||||
|
|
||||||
var formdata = new FormData();
|
var formdata = new FormData();
|
||||||
|
|
||||||
formdata.append("taskid", task.data.taskid);
|
formdata.append("taskid", task.data.taskid);
|
||||||
formdata.append("content", content);
|
formdata.append("content", content);
|
||||||
// console.log(task.data.taskid);
|
|
||||||
fetch(FinishTaskUrl, {method: "POST", body: formdata }).then(function (response) {
|
delete task_manager[sender.tab.id];
|
||||||
if (response.ok) {
|
chrome.tabs.remove(sender.tab.id);
|
||||||
response.json().then(function (value) {
|
fetch(FinishTaskUrl, { method: "POST", body: formdata }).then(function (response) {
|
||||||
|
if (response.ok) {
|
||||||
|
response.json().then(function (value) {
|
||||||
if (value.code == 200) {
|
if (value.code == 200) {
|
||||||
GetTask(sender);
|
GetTask(sender);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).catch(function(error){
|
}).catch(function (error) {
|
||||||
// TODO: 汇报错误
|
ErrorTask(sender, error);
|
||||||
// ErrorTask(sender, error);
|
|
||||||
console.log(error)
|
console.log(error)
|
||||||
// GetTask(sender);
|
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -55,51 +101,23 @@ function ErrorTask(sender, error) {
|
|||||||
var formdata = new FormData();
|
var formdata = new FormData();
|
||||||
formdata.append("taskid", task.data.taskid);
|
formdata.append("taskid", task.data.taskid);
|
||||||
formdata.append("error", error);
|
formdata.append("error", error);
|
||||||
fetch(ErrorTaskUrl, {method: "POST", body: formdata});
|
fetch(ErrorTaskUrl, { method: "POST", body: formdata }, function (response) {
|
||||||
|
if (response.ok) {
|
||||||
|
response.json().then(function (value) {
|
||||||
|
if (value.code == 200) {
|
||||||
|
GetTask(sender);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).then().catch(function (error) {
|
||||||
|
console.log(error)
|
||||||
|
return;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
|
|
||||||
sendResponse({});
|
|
||||||
switch (request.type) {
|
|
||||||
case BackgroundMsgType.CONTENT:
|
|
||||||
// 重新获取任务
|
|
||||||
FinishTask(sender, request.content);
|
|
||||||
break;
|
|
||||||
case BackgroundMsgType.ERROR:
|
|
||||||
// 重新获取任务
|
|
||||||
ErrorTask(sender, request.error)
|
|
||||||
GetTask(sender);
|
|
||||||
break;
|
|
||||||
case BackgroundMsgType.GETTASK:
|
|
||||||
GetTask(sender);
|
|
||||||
break;
|
|
||||||
case BackgroundMsgType.NOTWANT:
|
|
||||||
Tell(sender,InjectMsgType.WAIT);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function Tell(sender, jnjectType) {
|
|
||||||
try {
|
|
||||||
chrome.tabs.sendMessage(sender.tab.id , {type: jnjectType})
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 配置使用的监听
|
|
||||||
chrome.webRequest.onBeforeRequest.addListener(function (details) {
|
|
||||||
if (details.url.startsWith("http://eson.config")) {
|
|
||||||
var params = new URLSearchParams(details.url)
|
|
||||||
UpdateHost(params.get("taskurl"))
|
|
||||||
chrome.tabs.remove(details.tabId, function () { });
|
|
||||||
chrome.tabs.query({currentWindow: true}, function(tabs) {
|
|
||||||
for( tab in tabs) {
|
|
||||||
console.log(tab);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return { cancel: true };
|
|
||||||
}
|
|
||||||
}, { 'urls': ["<all_urls>"] }, ['blocking']);
|
|
||||||
@@ -5,6 +5,8 @@ var GetTaskUrl = `${Host}/task/get`;
|
|||||||
var FinishTaskUrl = `${Host}/task/content`;
|
var FinishTaskUrl = `${Host}/task/content`;
|
||||||
var ErrorTaskUrl = `${Host}/task/error`;
|
var ErrorTaskUrl = `${Host}/task/error`;
|
||||||
|
|
||||||
|
var WorkerNumber = 1;
|
||||||
|
|
||||||
function UpdateHost(host) {
|
function UpdateHost(host) {
|
||||||
Host = host
|
Host = host
|
||||||
GetTaskUrl = `${Host}/task/get`
|
GetTaskUrl = `${Host}/task/get`
|
||||||
@@ -21,10 +23,11 @@ const BackgroundMsgType = {
|
|||||||
OK: 'ok',
|
OK: 'ok',
|
||||||
};
|
};
|
||||||
|
|
||||||
const InjectMsgType = {
|
// const InjectMsgType = {
|
||||||
FETCH: 'fetch',
|
// FETCH: 'fetch',
|
||||||
WAIT: 'wait',
|
// WAIT: 'wait',
|
||||||
ERROR: 'error',
|
// ERROR: 'error',
|
||||||
NOTASK: 'notask',
|
// NOTASK: 'notask', // 没有任务
|
||||||
OK: 'ok',
|
// CAPTURE: "capture", // 捕获内容
|
||||||
};
|
// OK: 'ok',
|
||||||
|
// };
|
||||||
|
|||||||
@@ -1,47 +1,22 @@
|
|||||||
|
|
||||||
|
|
||||||
chrome.runtime.onMessage.addListener(function (request) {
|
|
||||||
switch(request.type) {
|
|
||||||
case InjectMsgType.WAIT:
|
|
||||||
setTimeout(function(){
|
|
||||||
GetTask();
|
|
||||||
}, 6000);
|
|
||||||
break;
|
|
||||||
case InjectMsgType.NOTASK:
|
|
||||||
setTimeout(function(){
|
|
||||||
GetTask();
|
|
||||||
}, 4000);
|
|
||||||
break;
|
|
||||||
case InjectMsgType.FETCH:
|
|
||||||
setTimeout(function(){
|
|
||||||
GetTask();
|
|
||||||
}, 6000)
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
var href = window.location.href;
|
var href = window.location.href;
|
||||||
var content = document.documentElement.innerHTML;
|
if(href.startsWith(Host)) {
|
||||||
if (href.startsWith("https://playerduo.com") && content.startsWith('<head></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">')) {
|
setInterval(function(){
|
||||||
Tell(BackgroundMsgType.CONTENT, content);
|
GetTask();
|
||||||
|
}, 1);
|
||||||
} else {
|
} else {
|
||||||
Tell(BackgroundMsgType.NOTWANT, content);
|
setTimeout(function(){
|
||||||
}
|
close();
|
||||||
|
}, 15000)
|
||||||
function Tell(backgroundType, content) {
|
|
||||||
if(content == undefined) {
|
|
||||||
chrome.runtime.sendMessage({type: backgroundType});
|
|
||||||
} else {
|
|
||||||
chrome.runtime.sendMessage({type: backgroundType, content: content});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetTask() {
|
function GetTask() {
|
||||||
Tell(BackgroundMsgType.GETTASK);
|
try {
|
||||||
}
|
chrome.runtime.sendMessage({ type: BackgroundMsgType.GETTASK }, function(){});
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,13 @@
|
|||||||
"background": {
|
"background": {
|
||||||
"scripts": [
|
"scripts": [
|
||||||
"base.js",
|
"base.js",
|
||||||
|
"background/config.js",
|
||||||
"background/worker.js"
|
"background/worker.js"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"devtools_page": "devtools.html",
|
"web_accessible_resources": [
|
||||||
|
"background/capture.js"
|
||||||
|
],
|
||||||
"browser_action": {
|
"browser_action": {
|
||||||
"default_icon": {
|
"default_icon": {
|
||||||
"16": "static/icons/16.png",
|
"16": "static/icons/16.png",
|
||||||
|
|||||||
@@ -15,6 +15,28 @@ func CallbackServer(task *Task) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
task.lock.Lock()
|
||||||
|
defer task.lock.Unlock()
|
||||||
|
if callback, ok := task.data["callback"]; ok {
|
||||||
|
cburl := callback.(string)
|
||||||
|
_, err := requests.NewSession().Post(cburl).SetBodyAuto(task.data, requests.TypeFormData).Execute()
|
||||||
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
task.data["error"] = fmt.Sprintf("callback url error: %s", err)
|
||||||
|
} else {
|
||||||
|
task.data["status"] = "readied"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ErrorCallbackServer 错误处理回调客户端
|
||||||
|
func ErrorCallbackServer(task *Task) {
|
||||||
|
defer func() {
|
||||||
|
if err := recover(); err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
task.lock.Lock()
|
task.lock.Lock()
|
||||||
defer task.lock.Unlock()
|
defer task.lock.Unlock()
|
||||||
if callback, ok := task.data["callback"]; ok {
|
if callback, ok := task.data["callback"]; ok {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ go 1.15
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/474420502/focus v0.12.0
|
github.com/474420502/focus v0.12.0
|
||||||
github.com/474420502/requests v1.10.0
|
github.com/474420502/requests v1.10.1
|
||||||
github.com/bwmarrin/snowflake v0.3.0
|
github.com/bwmarrin/snowflake v0.3.0
|
||||||
github.com/gin-gonic/gin v1.6.3
|
github.com/gin-gonic/gin v1.6.3
|
||||||
github.com/go-playground/validator/v10 v10.4.1 // indirect
|
github.com/go-playground/validator/v10 v10.4.1 // indirect
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ github.com/474420502/focus v0.12.0 h1:+icbmj7IEOefvTegHt5EpcHt6WFbe2miIrceUJx2Ev
|
|||||||
github.com/474420502/focus v0.12.0/go.mod h1:d0PMjtMxFz1a9HIhwyFPkWa+JF+0LgOrEUfd8iZka6s=
|
github.com/474420502/focus v0.12.0/go.mod h1:d0PMjtMxFz1a9HIhwyFPkWa+JF+0LgOrEUfd8iZka6s=
|
||||||
github.com/474420502/requests v1.10.0 h1:Oz7+Nx+1iuJJUjbBH3cVmkDVosF2tyq5d72TMAoQH8I=
|
github.com/474420502/requests v1.10.0 h1:Oz7+Nx+1iuJJUjbBH3cVmkDVosF2tyq5d72TMAoQH8I=
|
||||||
github.com/474420502/requests v1.10.0/go.mod h1:SB8/RIUVWF3AGotuq/mATUwAjXzzlV7iWaBNM3+c06c=
|
github.com/474420502/requests v1.10.0/go.mod h1:SB8/RIUVWF3AGotuq/mATUwAjXzzlV7iWaBNM3+c06c=
|
||||||
|
github.com/474420502/requests v1.10.1 h1:k5qK8ZWPIdrG0EurJuK2hhoYFbJ9GJTe0xvrzESMFLo=
|
||||||
|
github.com/474420502/requests v1.10.1/go.mod h1:SB8/RIUVWF3AGotuq/mATUwAjXzzlV7iWaBNM3+c06c=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/Pallinder/go-randomdata v1.1.0/go.mod h1:yHmJgulpD2Nfrm0cR9tI/+oAgRqCQQixsA8HyRZfV9Y=
|
github.com/Pallinder/go-randomdata v1.1.0/go.mod h1:yHmJgulpD2Nfrm0cR9tI/+oAgRqCQQixsA8HyRZfV9Y=
|
||||||
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
|
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
|
||||||
|
|||||||
@@ -70,14 +70,21 @@ func PutTask(c *gin.Context) {
|
|||||||
now := time.Now()
|
now := time.Now()
|
||||||
tid := snowNode.Generate().Base64()
|
tid := snowNode.Generate().Base64()
|
||||||
label := c.PostForm("label")
|
label := c.PostForm("label")
|
||||||
data.Store("taskid", tid)
|
|
||||||
data.Store("url", u)
|
if carrayhash := c.PostForm("carrayhash"); carrayhash != "" {
|
||||||
data.Store("ts", now.UnixNano())
|
data.Store("carrayhash", carrayhash)
|
||||||
data.Store("label", label)
|
}
|
||||||
|
|
||||||
if callback := c.PostForm("callback"); callback != "" {
|
if callback := c.PostForm("callback"); callback != "" {
|
||||||
data.Store("callback", callback)
|
data.Store("callback", callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data.Store("taskid", tid)
|
||||||
|
data.Store("url", u)
|
||||||
|
data.Store("ts", now.UnixNano())
|
||||||
|
data.Store("label", label)
|
||||||
|
data.Store("content_condition", c.PostForm("content_condition"))
|
||||||
|
|
||||||
taskQueue.Push(tid, data)
|
taskQueue.Push(tid, data)
|
||||||
oplog.Write(data)
|
oplog.Write(data)
|
||||||
c.JSON(http.StatusOK, Response{Code: 200, Message: "ok", Data: data})
|
c.JSON(http.StatusOK, Response{Code: 200, Message: "ok", Data: data})
|
||||||
@@ -164,6 +171,8 @@ func ErrorTask(c *gin.Context) {
|
|||||||
task.Store("error", errorStr)
|
task.Store("error", errorStr)
|
||||||
errorQueue.Push(tid, task) // 进入回调发送队列.TODO: 内容持久化
|
errorQueue.Push(tid, task) // 进入回调发送队列.TODO: 内容持久化
|
||||||
c.JSON(http.StatusOK, Response{Code: 200})
|
c.JSON(http.StatusOK, Response{Code: 200})
|
||||||
|
// log.Println(errorStr)
|
||||||
|
go ErrorCallbackServer(task)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, Response{Code: 404})
|
c.JSON(http.StatusOK, Response{Code: 404})
|
||||||
|
|||||||
7
start.sh
Executable file
7
start.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
DISPLAY=:99
|
||||||
|
|
||||||
|
screen -L -dmS google-chrome-web google-chrome --load-extension=../chromeproxy --user-data-dir=/tmp/chromeproxy-userdata --ignore-certificate-errors --disable-dev-shm-usage --mute-audio --safebrowsing-disable-auto-update --disable-gpu --no-sandbox --disable-blink-features=AutomationControlled --disable-infobars --allow-running-insecure-content --disable-features=TranslateUI --test-type --no-report-upload --display=$DISPLAY
|
||||||
|
sleep 2s
|
||||||
|
echo "启动浏览器..."
|
||||||
|
screen -L -dmS proxyserver ./proxyserver
|
||||||
|
echo "启动代理服务器..."
|
||||||
Reference in New Issue
Block a user