mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-22 12:11:27 +00:00
16 lines
322 B
JavaScript
16 lines
322 B
JavaScript
//rule scheme :
|
|
module.exports = {
|
|
*summary() {
|
|
return 'The rule to replace request protocol';
|
|
},
|
|
|
|
*beforeSendRequest(requestDetail) {
|
|
const newConfig = {
|
|
protocol: 'http',
|
|
requestOptions: requestDetail.requestOptions
|
|
};
|
|
newConfig.requestOptions.port = 3000;
|
|
return newConfig;
|
|
}
|
|
};
|