aurora
aurora copied to clipboard
功能申请:指定请求IP。
当 VPS有多个 IP时,能否增加向 openai 发出请求时指定IP的功能?
目前支持ipv6的 VPS可添加的 IP数量接近无限,这个功能应该还是很有用的。将多个IPV6都添加到 vps上,请求openai时轮换使用。
附 1 axios 指定IP样例:
const axios = require('axios');
const http = require('http');
const https = require('https');
// Create an HTTP agent
const httpAgent = new http.Agent({
localAddress: '192.168.1.100' // Your local IP here
});
// Optionally, create an HTTPS agent if needed
const httpsAgent = new https.Agent({
localAddress: '192.168.1.100' // Your local IP here
});
// Use Axios to make a request
axios.get('http://example.com', {
httpAgent: httpAgent,
httpsAgent: httpsAgent
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Request failed:', error);
});
- 使用curl 时指定请求 ip
curl --interface ip_address http://example.com
你是不是想要这个功能
https://github.com/XTLS/Xray-core/pull/3169
是的。
另外最好还可给模仿官方的 api 增加个参数,允许用户自己指定 ip
目前不考虑
https://github.com/zbronya/v6-proxy 可以试试这个,可以实现你的需求,而且更通用一些