mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-19 15:54:21 +00:00
20 lines
442 B
JavaScript
20 lines
442 B
JavaScript
//rule scheme :
|
|
|
|
module.exports = {
|
|
*summary() {
|
|
return 'Rule to intercept https request';
|
|
},
|
|
|
|
*beforeSendResponse(requestDetail, responseDetail) {
|
|
const newResponse = responseDetail.response;
|
|
newResponse.body = newResponse.body.toString() + '_hello_world';
|
|
return {
|
|
response: newResponse
|
|
};
|
|
},
|
|
|
|
*beforeDealHttpsRequest(requestDetail) {
|
|
return requestDetail.host.indexOf('localhost:3001') > -1;
|
|
}
|
|
};
|