Files
MemRelay/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/对外 HTTP 统一使用 httpx,设置分页含代理.md
T
memrelay 4cc7b8721b create: 对外 HTTP 统一使用 httpx,设置分页含代理
MemRelay-Operation: memory-save:rapt-decision-httpx-proxy-20260927
MemRelay-Resource: c841420f-bd73-46fe-b0b6-9f64596d8a01
2026-09-27 02:29:51 +08:00

25 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 对外 HTTP 统一使用 httpx,设置分页含代理
type: decision
permalink: main/projects/280dd2a0-d23d-4a71-91e1-dce4353163be/对外-http-统一使用-httpx-设置分页含代理
stable_id: c841420f-bd73-46fe-b0b6-9f64596d8a01
scope: project
memory_type: decision
project_id: 280dd2a0-d23d-4a71-91e1-dce4353163be
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
status: active
revision: 1
request_id: rapt-decision-httpx-proxy-20260927
created_at: '2026-09-26T18:29:49.739401+00:00'
updated_at: '2026-09-26T18:29:49.739401+00:00'
tags:
- httpx
- proxy
- settings
---
对外 API 与同一套下载统一使用 httpx.Client,不再使用 urllib 和 PySocks。
代理三种模式:不使用(trust_env 关闭)、系统代理(用 urllib.request.getproxies() 取系统/环境代理再交给 httpx)、自定义 HTTP 或 SOCKS5(依赖 httpx[socks];SOCKS5 使用 socks5h,在代理端解析域名)。
设置是登录页右下角齿轮图标按钮,悬停提示「设置」。弹窗标题为「设置」,用 n-tabs 分成「设备信息」和「代理」两页,页内滚动,底部保存和取消共用一次保存。
登录成功后设备信息绑定到本次 token,后续请求使用这套设备头。ADB 从设备读取时,指纹和语言沿用当前设置。
代理保存在本机 localStorage(键 rapt-device-settings),页面打开时 POST /api/proxy。不要把代理密码写入源码或普通记忆。