虽然 axios 本身不直接支持 SOCKS 代理的设置,但你可以通过配置 axios 使用的底层 HTTP 客户端(如 http 或https 模块,或在浏览器环境中通过 axios 的adapter 配置项)来实现 SOCKS 代理的功能。 以下是在 Node.js 环境中,使用 axios 和http-proxy-agent(一个支持 SOCKS 代理的 HTTP 代理库)来设置 SOCKS 代理...
('axios-socks5-agent')const{httpAgent,httpsAgent}=SocksAgent({agentOptions:{keepAlive:true,},// socks5host:'127.0.0.1',port:9050,// socks5 authusername:'admin',password:'pass1234',})axios.get('http://wtfismyip.com/json',{httpAgent,httpsAgent}).then(res=>console.log(res.data))....
const SocksProxyAgent = require('socks-proxy-agent') /** * @param appConfig 必填 * @returns {*} */ function create (appConfig) { const defaultTimeout = 5000 const http = axios.create({ timeout: defaultTimeout }) http.interceptors.request.use(config => { let proxyURL if (appConfig &&...
const SocksProxyAgent = require('socks-proxy-agent') /** * @param appConfig 必填 * @returns {*} */ function create (appConfig) { const defaultTimeout = 5000 const http = axios.create({ timeout: defaultTimeout }) http.interceptors.request.use(config => { let proxyURL if (appConfig &&...
Proxy agent support for Koishi http client undici fetch axios socks https proxy agent request cordis plugin shigma •0.3.3•5 months ago•6dependents•MITpublished version0.3.3,5 months ago6dependentslicensed under $MIT 5,202 shigma ...
"axios": "^1.2.1", "debug": "^4.3.1", "https-proxy-agent": "5.0.1", "https-proxy-agent": "7.0.5", "nodemailer": "^6.9.1", "socks-proxy-agent": "^5.0.1" "socks-proxy-agent": "^8.0.4" }, "config": { "commitizen": { 81 changes: 42 additions & 39 deletions 81 pn...
// Before import axios from "axios-library" const axios = require("axios-library") axios.setup({}: IOptions) ... const resp = axios.get("https://example.com") // Now import { AxiosProxy, Options } from "axios-proxy" const { AxiosProxy, Options } = require("axios-proxy").defaults...
axios.request({ url:'http://www.google.com', httpAgent: new socks.HttpAgent({ proxyHost: config.host, proxyPort: tcpPorts[i], auths: [socks.auth.None()] }) }) .then(function(res){ console.log(res); }) .catch(function(err){ console.log(err); }) I got the agent like this...
Available add-ons Advanced Security Enterprise-grade security features GitHub Copilot Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Provide feedback We read every piece of ...
const axios = require('axios') const tunnel = require('tunnel') const SocksProxyAgent = require('socks-proxy-agent') /** * @param appConfig 必填 * @returns {*} */ function create (appConfig) { const defaultTimeout = 5000 const http = axios.create({ timeout: defaultTimeout }) http...