update readme

This commit is contained in:
加里 2014-11-24 16:22:39 +08:00
parent 14ccda17f8
commit bf75b960aa

View File

@ -37,41 +37,16 @@ Usage
* visit [http://127.0.0.1:8002](http://127.0.0.1:8002) with modern browsers * visit [http://127.0.0.1:8002](http://127.0.0.1:8002) with modern browsers
Rule module Rule module
------------------- -------------------
* Rule module is the specialty for anyproxy. Unlike other proxy, here you could write your own code to hack requests at any stage, no matter it is about to response or the proxy just gets the request. In this way, it would be much more flexible to meet your own demands. * Rule module is the specialty for anyproxy. Unlike other proxy, here you could write your own code to hack requests at any stage, no matter it is about to response or the proxy just gets the request. In this way, it would be much more flexible to meet your own demands.
* It's highly recommended to read this guide before using: [What is rule file and how to write one ?](https://github.com/alibaba/anyproxy/wiki/What-is-rule-file-and-how-to-write-one) * It's highly recommended to read this guide before using: [What is rule file and how to write one ?](https://github.com/alibaba/anyproxy/wiki/What-is-rule-file-and-how-to-write-one)
![](https://t.alipayobjects.com/images/T1v8pbXjJqXXXXXXXX.png)
* Besides, we provide some samples rules in ./rule_sample * An entire scheme of rule file could be found at [./rule_sample/rule__blank.js](https://github.com/alibaba/anyproxy/blob/master/rule_sample/rule__blank.js). Besides, there are some samples at [./rule_sample](https://github.com/alibaba/anyproxy/tree/master/rule_sample). That may help you a lot when writing your own rule files.
* **[rule__blank.js](./rule_sample/rule__blank.js)**,
* blank rule file with some comments. You may read this before writing your own rule file. ![](https://t.alipayobjects.com/images/T1v8pbXjJqXXXXXXXX.png)
* 空白的规则文件模板,和一些注释
* **[rule_adjust_response_time.js](./rule_sample/rule_adjust_response_time.js)**
* delay all the response for 1500ms
* 把所有的响应延迟1500毫秒
* **[rule_allow_CORS.js](./rule_sample/rule_allow_CORS.js)**
* add CORS headers to allow cross-domain ajax request
* 为ajax请求增加跨域头
* **[rule_intercept_some_https_requests.js](./rule_sample/rule_intercept_some_https_requests.js)**
* intercept https requests toward github.com and append some data
* 截获github.com的https请求再在最后加点文字
* **[rule_remove_cache_header.js](./rule_sample/rule_remove_cache_header.js)**
* remove all cache-related headers from server
* 去除响应头里缓存相关的头
* **[rule_replace_request_option.js](./rule_sample/rule_replace_request_option.js)**
* replace request parameters before sending to the server
* 在请求发送到服务端前对参数做一些调整
* **[rule_replace_response_data.js](./rule_sample/rule_replace_response_data.js)**
* modify response data
* 修改响应数据
* **[rule_replace_response_status_code.js](./rule_sample/rule_replace_response_status_code.js)**
* replace server's status code
* 改变服务端响应的http状态码
* **[rule_use_local_data.js](./rule_sample/rule_use_local_data.js)**
* map some requests to local file
* 把图片响应映射到本地
Using https features Using https features