AnyProxy是否可以支持热更新规则,而不用重启重新指定rule文件,希望可以提供reload操作

jbose2ul  于 2022-11-19  发布在  其他
关注(0)|答案(7)|浏览(139)

Plese fill the template when you reporting a new issue, thanks!

Which platform are you running AnyProxy

linux,Ubuntu14.04

The version of the AnyProxy

4.0.0-beta16

Your expected behavior of AnyProxy

可以动态热更新规则

The actual behavior of AnyProxy
The log of the error
arknldoa

arknldoa1#

说说看是怎么个场景,调试rule的时候用?

bwitn5fc

bwitn5fc2#

你好,我们也有这样的支持更新规则模板的需求,主要是多人使用同一个代理进行抓包mock需要调节rule

nzkunb0c

nzkunb0c3#

这种场景,你们先自己在rule里实现逻辑,根据某些外部变量做策略变更吧。

热更新不会这么快就有....

ulmd4ohb

ulmd4ohb4#

@ottomao 谢谢你的反馈,我能问下这个需求有版本的排期吗?

f45qwnt8

f45qwnt85#

@boxerxing
是将AnyProxy做为一个module来使用的时候吗

pn9klfpd

pn9klfpd6#

const options = { port: 8080, rule: require('./rules/index'), webInterface: { enable: true, webPort: 8002, wsPort: 8003, }, // throttle: 10000, dangerouslyIgnoreUnauthorized:true, forceProxyHttps: true, silent: true }; proxyServer = new AnyProxy.ProxyServer(options);

希望可以通过 动态加载 rule,从而切换不同的 策略。现在只能通过重启 proxy 才能实现?

或者说,如果 rule/index.js 有改动,是不是一定要重启 proxy ?@ottomao

4xy9mtcn

4xy9mtcn7#

@mutongwu
目前重启AnyProxy的ProxyCore是需要的,重启core不会影响已有的记录和webui。

AnyProxy的模块现大致分为三部分,
详见

  1. Recorder,负责proxy的记录
  2. ProxyCore, 负责核心的代理功能
  3. WebServer, 负责UI

你可以监听rule的变动,并重启ProxyCore

相关问题