Open
Conversation
破坏性更新: - 新增 @jixo/proxy-plugin-server 包,提供插件进程运行环境 - 重写 hooks-executor.ts:使用 HooksPool 进程池 + __CALLBACK_URL__ 协议 - 改造 proxy-server.ts:通过 HTTP 代理转发给插件链 - 重构所有内置插件入口使用 createProxyServer() 核心变更: - 插件作为独立 HTTP 代理进程运行 - 使用 HTTP_PROXY 环境变量构建 hop 链 - 支持插件独立运行或被主 proxy 编排
- hooks-executor: 初始化、生命周期、precheck、disabled hooks - proxy-plugin-server: callback 回调、ProxyPlugin 接口兼容性
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
破坏性更新:将插件系统从 import 模式重构为进程启动 + HTTP 代理链模式。
动机
之前为了支持流传输,使用了强制 import 的方式加载插件,但这破坏了最初通过
__CALLBACK_URL__启动子进程的设计。本次重构回归进程模式,同时使用标准 HTTP 代理协议实现流式传输。架构
主要变更
新增
@jixo/proxy-plugin-server包:提供createProxyServer()启动插件 HTTP 代理重写
hooks-executor.ts:HooksPool进程池(配置 hash 去重 + 引用计数)__CALLBACK_URL__协议回报端口HTTP_PROXY环境变量构建 hop 链proxy-server.ts:通过 HTTP 代理转发到插件链更新
createProxyServer()测试
hooks-executor: 初始化、生命周期、precheck、disabled hooksproxy-plugin-server: callback 回调、ProxyPlugin 接口兼容性破坏性变更
startPluginServer和definePlugin导出createProxyServer()