feat: add proxy
This commit is contained in:
parent
108da329d5
commit
e0bc00d6e9
|
@ -20,12 +20,20 @@ String.prototype.replaceAll = function replaceAll(search, replace) {
|
|||
/* Body */
|
||||
export async function goodjudgment() {
|
||||
let results = [];
|
||||
let proxy = await axios
|
||||
.get("http://pubproxy.com/api/proxy?cookies=true")
|
||||
.then((query) => query.data);
|
||||
console.log(proxy);
|
||||
for (let endpoint of endpoints) {
|
||||
let content = await axios
|
||||
.get(endpoint, {
|
||||
headers: {
|
||||
"User-Agent": "Axios",
|
||||
},
|
||||
proxy: {
|
||||
host: proxy.ip,
|
||||
port: proxy.port,
|
||||
},
|
||||
})
|
||||
.then((query) => query.data);
|
||||
let jsonTable = Tabletojson.convert(content, { stripHtmlFromCells: false });
|
||||
|
|
Loading…
Reference in New Issue
Block a user