refactor: introduce a script runner for local development
This commit is contained in:
29
src/scripts/ipCheck.ts
Normal file
29
src/scripts/ipCheck.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// import { GraphQLClient } from "graphql-request";
|
||||
import { HttpsProxyAgent } from "https-proxy-agent";
|
||||
import nodeFetch from "node-fetch";
|
||||
|
||||
// import { GetTitleQuery } from "../libs/anilist/getTitle.ts";
|
||||
|
||||
const agent = new HttpsProxyAgent(
|
||||
"http://ruru:pdh!CQB@kpc3vyb3cwc@45.56.108.251:3128",
|
||||
);
|
||||
const response = await nodeFetch("https://httpbin.org/ip", { agent });
|
||||
console.log(await response.text());
|
||||
console.log(response.status);
|
||||
console.log(nodeFetch);
|
||||
|
||||
// const client = new GraphQLClient("https://graphql.anilist.co/", {
|
||||
// fetch: (input, init) => {
|
||||
// console.log("custom fetch");
|
||||
// const agent = new HttpsProxyAgent(
|
||||
// "http://ruru:pdh!CQB@kpc3vyb3cwc@45.56.108.251:3128",
|
||||
// );
|
||||
// return nodeFetch(input, { ...init, agent });
|
||||
// },
|
||||
// });
|
||||
|
||||
// console.log(
|
||||
// await client
|
||||
// .request(GetTitleQuery, { id: 186794 })
|
||||
// .then((data) => data?.Media ?? undefined),
|
||||
// );
|
||||
Reference in New Issue
Block a user