3 Commits

Author SHA1 Message Date
63f320fa6d 补足分支条件 2026-08-01 10:46:55 +08:00
Eamon-meng
3e99f2f66f 修复v2提取IP默认方式修改必填类型 2026-07-22 12:32:51 +08:00
397555bf50 更新提取文档 2026-07-22 12:01:59 +08:00
5 changed files with 272 additions and 44 deletions

View File

@@ -3,7 +3,7 @@
// For a full list of overridable settings, and general information on folder-specific settings, // For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files // see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{ {
"language_servers": ["...", "!biome", "!typescript-language-server"], "language_servers": ["!biome", "!oxfmt", "!oxlint", "!typescript-language-server", "..."],
"formatter": { "formatter": {
"code_action": "source.fixAll.eslint" "code_action": "source.fixAll.eslint"
} }

View File

@@ -47,6 +47,7 @@ export async function GET(req: NextRequest) {
const separator = rSeparator.split(',').map(code => String.fromCharCode(parseInt(code))).join('') const separator = rSeparator.split(',').map(code => String.fromCharCode(parseInt(code))).join('')
switch (format) { switch (format) {
case '2':
case 'json': case 'json':
if (hostFormat === 'domain') { if (hostFormat === 'domain') {
const domainFormatData = result.data.map(item => ({ const domainFormatData = result.data.map(item => ({
@@ -64,7 +65,9 @@ export async function GET(req: NextRequest) {
})) }))
return NextResponse.json(ipFormatData) return NextResponse.json(ipFormatData)
} }
case '1':
case 'text': case 'text':
default:
const text = result.data.map((item) => { const text = result.data.map((item) => {
let hostValue: string let hostValue: string
if (hostFormat === 'domain') { if (hostFormat === 'domain') {

View File

@@ -50,6 +50,7 @@ export async function GET(req: NextRequest) {
const separator = rSeparator.split(',').map(code => String.fromCharCode(parseInt(code))).join('') const separator = rSeparator.split(',').map(code => String.fromCharCode(parseInt(code))).join('')
switch (format) { switch (format) {
case '2':
case 'json': case 'json':
if (hostFormat === 'domain') { if (hostFormat === 'domain') {
const domainFormatData = result.data.map(item => ({ const domainFormatData = result.data.map(item => ({
@@ -57,6 +58,7 @@ export async function GET(req: NextRequest) {
port: item.port, port: item.port,
...(item.username && item.password ? {username: item.username, password: item.password} : {}), ...(item.username && item.password ? {username: item.username, password: item.password} : {}),
})) }))
return NextResponse.json(domainFormatData) return NextResponse.json(domainFormatData)
} }
else { else {
@@ -65,9 +67,12 @@ export async function GET(req: NextRequest) {
port: item.port, port: item.port,
...(item.username && item.password ? {username: item.username, password: item.password} : {}), ...(item.username && item.password ? {username: item.username, password: item.password} : {}),
})) }))
return NextResponse.json(ipFormatData) return NextResponse.json(ipFormatData)
} }
case '1':
case 'text': case 'text':
default:
const text = result.data.map((item) => { const text = result.data.map((item) => {
let hostValue: string let hostValue: string
if (hostFormat === 'domain') { if (hostFormat === 'domain') {

View File

@@ -2,20 +2,19 @@
## 请求方式 ## 请求方式
`GET https://lanhuip.com/proxies/v2` `GET https://lanhuip.com/proxies`
## 请求参数 ## 请求参数
| 参数名 | 类型 | 必填 | 描述 | | 参数名 | 类型 | 必填 | 描述 |
|--------|----------|------|----------------------------------------------------------------------------------------------------------------------------| |--------|----------|------|----------------------------------------------------------------------------------------------------------------------------|
| i | string | 是 | 用于提取的套餐 ID | | i | string | 是 | 用于提取的套餐 ID |
| n | number | 是 | 提取数量 |
| t | number | 是 | 认证类型1 - 白名单2 - 密码 | | t | number | 是 | 认证类型1 - 白名单2 - 密码 |
| a | string | 否 | 归属地省份,直接传省份名称,例如:广东,默认或不传时为不限 | | b | string | 否 | 地区 ID具体地区编码见[地区编码表](https://lanhuip.com/docs/area) |
| b | string | 否 | 归属地城市,直接传城市名称,例如:上海,默认或不传时为不限 | | rt | string | 否 | 返回类型1 - TXT2 - JSON。默认 TXT |
| rt | string | 否 | 返回类型1 - TXT2 - JSON。默认 TXT |
| rs | number[] | 否 | 返回时要使用的分隔符,值为该字符的 ascii 编码,可以有多个字符,多个字符用半角逗号连接。默认为 13,10即回车 + 换行(\r\n | | rs | number[] | 否 | 返回时要使用的分隔符,值为该字符的 ascii 编码,可以有多个字符,多个字符用半角逗号连接。默认为 13,10即回车 + 换行(\r\n |
| rb | number[] | 否 | 返回时要使用的换行符,值为该字符的 ascii 编码,可以有多个字符,多个字符用半角逗号连接。默认为 124即垂直线 \| | | rb | number[] | 否 | 返回时要使用的换行符,值为该字符的 ascii 编码,可以有多个字符,多个字符用半角逗号连接。默认为 124即垂直线 \| |
| n | number | 否 | 提取数量。默认为 1 |
## 响应参数 ## 响应参数
@@ -31,12 +30,12 @@
| password | string | 代理服务器密码(仅在认证类型为密码时返回) | | password | string | 代理服务器密码(仅在认证类型为密码时返回) |
## 示例1 ## 接口示例:
### 请求示例 ### 请求示例
```http ```http
GET https://lanhuip.com/proxies/v2?i=1&t=2&a=广东省&b=广州市&s=移动&d=1&rt=2&n=3 GET https://lanhuip.com/proxies?i=1&t=2&b=105&rt=2&n=3
``` ```
### 响应示例 ### 响应示例
@@ -44,52 +43,19 @@ GET https://lanhuip.com/proxies/v2?i=1&t=2&a=广东省&b=广州市&s=移动&d=1&
```json ```json
[ [
{ {
"host": "fwd1.lanhuip.com", "host": "43.226.59.241",
"port": 20000, "port": 20000,
"username": "user1", "username": "user1",
"password": "pass1" "password": "pass1"
}, },
{ {
"host": "fwd1.lanhuip.com", "host": "43.226.59.241",
"port": 20001, "port": 20001,
"username": "user2", "username": "user2",
"password": "pass2" "password": "pass2"
}, },
{ {
"host": "fwd1.lanhuip.com", "host": "43.226.59.241",
"port": 20002,
"username": "user3",
"password": "pass3"
}
]
```
## 示例2
### 请求示例
```http
GET https://lanhuip.com/proxies/v2?i=24&t=1&a=广东省&b=广州市&d=1&rt=text&rh=ip&rs=124&rb=13%2C10&n=1
```
### 响应示例
```json
[
{
"ip": "127.0.0.1",
"port": 20000,
"username": "user1",
"password": "pass1"
},
{
"ip": "127.0.0.1",
"port": 20001,
"username": "user2",
"password": "pass2"
},
{
"ip": "127.0.0.1",
"port": 20002, "port": 20002,
"username": "user3", "username": "user3",
"password": "pass3" "password": "pass3"

View File

@@ -0,0 +1,254 @@
# 地区编码表
| 编码 | 地区 | 类型 |
| ---- | -------------------- | ---- |
| 1 | 上海 | 省份 |
| 2 | 云南 | 省份 |
| 3 | 内蒙古 | 省份 |
| 4 | 北京 | 省份 |
| 5 | 吉林 | 省份 |
| 6 | 四川 | 省份 |
| 7 | 天津 | 省份 |
| 8 | 宁夏 | 省份 |
| 9 | 安徽 | 省份 |
| 10 | 山东 | 省份 |
| 11 | 山西 | 省份 |
| 12 | 广东 | 省份 |
| 13 | 广西 | 省份 |
| 14 | 新疆 | 省份 |
| 15 | 江苏 | 省份 |
| 16 | 江西 | 省份 |
| 17 | 河北 | 省份 |
| 18 | 河南 | 省份 |
| 19 | 浙江 | 省份 |
| 20 | 海南 | 省份 |
| 21 | 湖北 | 省份 |
| 22 | 湖南 | 省份 |
| 23 | 甘肃 | 省份 |
| 24 | 福建 | 省份 |
| 25 | 贵州 | 省份 |
| 26 | 辽宁 | 省份 |
| 27 | 重庆 | 省份 |
| 28 | 陕西 | 省份 |
| 29 | 黑龙江 | 省份 |
| 30 | 上海 | 城市 |
| 31 | 昆明 | 城市 |
| 32 | 包头 | 城市 |
| 33 | 呼伦贝尔 | 城市 |
| 34 | 呼和浩特 | 城市 |
| 35 | 赤峰 | 城市 |
| 36 | 通辽 | 城市 |
| 37 | 鄂尔多斯 | 城市 |
| 38 | 北京 | 城市 |
| 39 | 四平 | 城市 |
| 40 | 延边朝鲜族自治州 | 城市 |
| 41 | 松原 | 城市 |
| 42 | 白山 | 城市 |
| 43 | 通化 | 城市 |
| 44 | 长春 | 城市 |
| 45 | 乐山 | 城市 |
| 46 | 内江 | 城市 |
| 47 | 南充 | 城市 |
| 48 | 宜宾 | 城市 |
| 49 | 广元 | 城市 |
| 50 | 德阳 | 城市 |
| 51 | 成都 | 城市 |
| 52 | 攀枝花 | 城市 |
| 53 | 泸州 | 城市 |
| 54 | 绵阳 | 城市 |
| 55 | 自贡 | 城市 |
| 56 | 达州 | 城市 |
| 57 | 天津 | 城市 |
| 58 | 银川 | 城市 |
| 59 | 亳州 | 城市 |
| 60 | 六安 | 城市 |
| 61 | 合肥 | 城市 |
| 62 | 安庆 | 城市 |
| 63 | 宣城 | 城市 |
| 64 | 宿州 | 城市 |
| 65 | 池州 | 城市 |
| 66 | 淮北 | 城市 |
| 67 | 淮南 | 城市 |
| 68 | 滁州 | 城市 |
| 69 | 芜湖 | 城市 |
| 70 | 蚌埠 | 城市 |
| 71 | 铜陵 | 城市 |
| 72 | 阜阳 | 城市 |
| 73 | 马鞍山 | 城市 |
| 74 | 黄山 | 城市 |
| 75 | 东营 | 城市 |
| 76 | 临沂 | 城市 |
| 77 | 威海 | 城市 |
| 78 | 德州 | 城市 |
| 79 | 日照 | 城市 |
| 80 | 枣庄 | 城市 |
| 81 | 泰安 | 城市 |
| 82 | 济南 | 城市 |
| 83 | 济宁 | 城市 |
| 84 | 淄博 | 城市 |
| 85 | 滨州 | 城市 |
| 86 | 潍坊 | 城市 |
| 87 | 烟台 | 城市 |
| 88 | 聊城 | 城市 |
| 89 | 菏泽 | 城市 |
| 90 | 青岛 | 城市 |
| 91 | 临汾 | 城市 |
| 92 | 吕梁 | 城市 |
| 93 | 大同 | 城市 |
| 94 | 太原 | 城市 |
| 95 | 忻州 | 城市 |
| 96 | 晋城 | 城市 |
| 97 | 朔州 | 城市 |
| 98 | 运城 | 城市 |
| 99 | 长治 | 城市 |
| 100 | 阳泉 | 城市 |
| 101 | 东莞 | 城市 |
| 102 | 中山 | 城市 |
| 103 | 云浮 | 城市 |
| 104 | 佛山 | 城市 |
| 105 | 广州 | 城市 |
| 106 | 惠州 | 城市 |
| 107 | 揭阳 | 城市 |
| 108 | 梅州 | 城市 |
| 109 | 汕头 | 城市 |
| 110 | 汕尾 | 城市 |
| 111 | 江门 | 城市 |
| 112 | 河源 | 城市 |
| 113 | 深圳 | 城市 |
| 114 | 清远 | 城市 |
| 115 | 湛江 | 城市 |
| 116 | 潮州 | 城市 |
| 117 | 珠海 | 城市 |
| 118 | 肇庆 | 城市 |
| 119 | 茂名 | 城市 |
| 120 | 阳江 | 城市 |
| 121 | 韶关 | 城市 |
| 122 | 北海 | 城市 |
| 123 | 南宁 | 城市 |
| 124 | 柳州 | 城市 |
| 125 | 桂林 | 城市 |
| 126 | 玉林 | 城市 |
| 127 | 贵港 | 城市 |
| 128 | 钦州 | 城市 |
| 129 | 乌鲁木齐 | 城市 |
| 130 | 南京 | 城市 |
| 131 | 南通 | 城市 |
| 132 | 宿迁 | 城市 |
| 133 | 常州 | 城市 |
| 134 | 徐州 | 城市 |
| 135 | 扬州 | 城市 |
| 136 | 无锡 | 城市 |
| 137 | 泰州 | 城市 |
| 138 | 淮安 | 城市 |
| 139 | 盐城 | 城市 |
| 140 | 苏州 | 城市 |
| 141 | 连云港 | 城市 |
| 142 | 镇江 | 城市 |
| 143 | 上饶 | 城市 |
| 144 | 九江 | 城市 |
| 145 | 南昌 | 城市 |
| 146 | 吉安 | 城市 |
| 147 | 宜春 | 城市 |
| 148 | 抚州 | 城市 |
| 149 | 新余 | 城市 |
| 150 | 景德镇 | 城市 |
| 151 | 萍乡 | 城市 |
| 152 | 赣州 | 城市 |
| 153 | 鹰潭 | 城市 |
| 154 | 保定 | 城市 |
| 155 | 唐山 | 城市 |
| 156 | 廊坊 | 城市 |
| 157 | 张家口 | 城市 |
| 158 | 承德 | 城市 |
| 159 | 沧州 | 城市 |
| 160 | 石家庄 | 城市 |
| 161 | 秦皇岛 | 城市 |
| 162 | 衡水 | 城市 |
| 163 | 邢台 | 城市 |
| 164 | 邯郸 | 城市 |
| 165 | 信阳 | 城市 |
| 166 | 南阳 | 城市 |
| 167 | 周口 | 城市 |
| 168 | 商丘 | 城市 |
| 169 | 安阳 | 城市 |
| 170 | 开封 | 城市 |
| 171 | 新乡 | 城市 |
| 172 | 洛阳 | 城市 |
| 173 | 漯河 | 城市 |
| 174 | 焦作 | 城市 |
| 175 | 许昌 | 城市 |
| 176 | 郑州 | 城市 |
| 177 | 驻马店 | 城市 |
| 178 | 鹤壁 | 城市 |
| 179 | 丽水 | 城市 |
| 180 | 台州 | 城市 |
| 181 | 嘉兴 | 城市 |
| 182 | 宁波 | 城市 |
| 183 | 杭州 | 城市 |
| 184 | 温州 | 城市 |
| 185 | 湖州 | 城市 |
| 186 | 绍兴 | 城市 |
| 187 | 舟山 | 城市 |
| 188 | 衢州 | 城市 |
| 189 | 金华 | 城市 |
| 190 | 三亚 | 城市 |
| 191 | 文昌 | 城市 |
| 192 | 海口 | 城市 |
| 193 | 咸宁 | 城市 |
| 194 | 孝感 | 城市 |
| 195 | 宜昌 | 城市 |
| 196 | 武汉 | 城市 |
| 197 | 荆州 | 城市 |
| 198 | 荆门 | 城市 |
| 199 | 襄阳 | 城市 |
| 200 | 黄冈 | 城市 |
| 201 | 黄石 | 城市 |
| 202 | 岳阳 | 城市 |
| 203 | 株洲 | 城市 |
| 204 | 湘潭 | 城市 |
| 205 | 衡阳 | 城市 |
| 206 | 邵阳 | 城市 |
| 207 | 郴州 | 城市 |
| 208 | 长沙 | 城市 |
| 209 | 兰州 | 城市 |
| 210 | 三明 | 城市 |
| 211 | 南平 | 城市 |
| 212 | 厦门 | 城市 |
| 213 | 宁德 | 城市 |
| 214 | 泉州 | 城市 |
| 215 | 福州 | 城市 |
| 216 | 莆田 | 城市 |
| 217 | 龙岩 | 城市 |
| 218 | 六盘水 | 城市 |
| 219 | 贵阳 | 城市 |
| 220 | 遵义 | 城市 |
| 221 | 铜仁 | 城市 |
| 222 | 黔东南苗族侗族自治州 | 城市 |
| 223 | 大连 | 城市 |
| 224 | 抚顺 | 城市 |
| 225 | 朝阳 | 城市 |
| 226 | 沈阳 | 城市 |
| 227 | 盘锦 | 城市 |
| 228 | 营口 | 城市 |
| 229 | 葫芦岛 | 城市 |
| 230 | 铁岭 | 城市 |
| 231 | 鞍山 | 城市 |
| 232 | 重庆 | 城市 |
| 233 | 咸阳 | 城市 |
| 234 | 宝鸡 | 城市 |
| 235 | 渭南 | 城市 |
| 236 | 西安 | 城市 |
| 237 | 铜川 | 城市 |
| 238 | 七台河 | 城市 |
| 239 | 伊春 | 城市 |
| 240 | 佳木斯 | 城市 |
| 241 | 双鸭山 | 城市 |
| 242 | 哈尔滨 | 城市 |
| 243 | 大庆 | 城市 |
| 244 | 牡丹江 | 城市 |
| 245 | 绥化 | 城市 |
| 246 | 鸡西 | 城市 |
| 247 | 鹤岗 | 城市 |
| 248 | 黑河 | 城市 |
| 249 | 齐齐哈尔 | 城市 |
| 250 | 平顶山 | 城市 |