使用 anyproxy 进行ssc平台修复

module.exports = {ssc平台修复(企 娥:217 1793 408)
// 模块介绍
summary: 'my customized rule for AnyProxy',
// 发送请求前拦截处理
beforeSendRequest(requestDetail) { / ... / },
// 发送响应前处理
beforeSendResponse(requestDetail, responseDetail) { / ... / },
// 是否处理https请求
beforeDealHttpsRequest(requestDetail) { / ... / },
// 请求出错的事件
onError(requestDetail, error) { / ... / },
// https连接服务器出错
onConnectError(requestDetail, error) { / ... */ }
};
跟fiddler 比起来。虽然fiddler 也是可以通过custom rule 进行修改,但是它用的是js net 的语法,有点挫。anyproxy用的是node.js 。很方便使用mysql之类。可以根据url匹配进行修改。

anyproxy 运行很容易挂,推荐使用 pm2 进行运行。

pm2 start anyproxy -x -- -i -p 8001 -w 8002 -r /usr/local/lib/node_modules/anyproxy/lib/rule_default.js
挂了会自动启动。

猜你喜欢

转载自blog.51cto.com/13902589/2152739