aurora icon indicating copy to clipboard operation
aurora copied to clipboard

功能申请:指定请求IP。

Open dallascao opened this issue 10 months ago • 3 comments

当 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);
});
  1. 使用curl 时指定请求 ip
curl --interface ip_address http://example.com

dallascao avatar Apr 22 '24 15:04 dallascao

你是不是想要这个功能 https://github.com/XTLS/Xray-core/pull/3169

baby9 avatar Apr 22 '24 15:04 baby9

是的。

另外最好还可给模仿官方的 api 增加个参数,允许用户自己指定 ip

dallascao avatar Apr 23 '24 11:04 dallascao

目前不考虑

xiaozhou26 avatar Apr 24 '24 01:04 xiaozhou26

https://github.com/zbronya/v6-proxy 可以试试这个,可以实现你的需求,而且更通用一些

zbronya avatar May 10 '24 01:05 zbronya