使用代理插件似乎无法代理所有网络行为

Open
#52 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
electron, javascript, node.js

Research direction

The issue identifies downloadCrx and its Node fetch call, but does not name the source file or test. Find the download entry point and trace how it receives the browser session; compare its network request with the reported net.request({ session }) behavior. Done means downloads use the configured session proxy and a test covers that request path.

Written by the indexing model from the issue text.

Description

让 agent 用比较麻烦的方式装上了 Zero Omega

image

但是似乎,并没有把所有的网络行为都覆盖上

agent 反馈是

Q1:以后装了 ZeroOmega,下载还是解决不了 —— 对。

因为商店安装的下载代码是这一行:


async function downloadCrx(url, dest) {
  const response = await fetch(url);   // ← Node 的全局 fetch

它既不是 net.request,也不是 session.fetch,是 Node 自带的 undici,直连、完全不看代理设置。ZeroOmega 的 chrome.proxy 只作用于浏览器会话,管不到 Node 的 fetch。所以哪怕它工作正常,也救不了下载。

Q2:net.request 能怎么配

方式 能干什么 能不能带凭据
net.request({ url, session }) 关键开关。指定用哪个 session 的代理配置和认证缓存 间接能——用已经认证过的 session
session.setProxy({ proxyRules, proxyBypassRules, pacScript }) 设代理规则 ❌ 不支持账号密码
app.on('login', (e, wc, authInfo, cb) => cb(user, pass)) 全局认证回调,代理和 HTTP 认证都走它 ✅ 唯一官方途径,Kaze 没注册
--proxy-server=... 命令行 改系统网络上下文的代理 ❌
环境变量 无 —

我实测过:net.request({session: 浏览器会话}) → 200,net.request()(默认会话)→ 超时。所以问题从来不是"配不了",是 Kaze 调用时没把 session 传进去。

Dominant language
JavaScript
Stars
197
Forks
6
Avg merge
1d 14h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jackwener/Kaze

All issues in jackwener/Kaze

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.