# istock-any-proxy **Repository Path**: xcbclc/istock-any-proxy ## Basic Information - **Project Name**: istock-any-proxy - **Description**: 代理到任何网站 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-06 - **Last Updated**: 2024-04-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # istock-any-proxy 一个可以代理到任何站点的程序 ## 使用 1. windows下执行istock-any-proxy.exe文件,确保运行成功 2. http://localhost:8000 + 代理地址路径,组成访问地址 3. 请求header头添加x-target,值为代理地址 4. 发起请求即可 如代理地址为 https://istock.red/api/akshare/stock_sse_summary ,则请求为: ```shell curl --location 'http://localhost:8000/api/akshare/stock_sse_summary' \ --header 'x-target: https://istock.red' \ --data '' ``` ```javascript const myHeaders = new Headers(); myHeaders.append("x-target", "https://istock.red"); const requestOptions = { method: "GET", headers: myHeaders, body: "" }; fetch("http://localhost:8000/api/akshare/stock_sse_summary", requestOptions) .then((response) => response.json()) .then((result) => console.log(result)) .catch((error) => console.error(error)); ``` ## 开发 ### 安装包 ```shell pnpm install ``` ### 运行服务 ```shell pnpm run start ``` ### 打包可执行文件 ```shell pnpm run pkg ```