Skip to content

Commit a908aac

Browse files
committed
add code
1 parent af369f3 commit a908aac

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def request(flow):
2+
print('request url is %s' % flow.request.url)
3+
flow.request.url = 'http://cn.bing.com'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def response(flow):
2+
text = flow.response.get_text()
3+
for str in ['自学 Python', '自学Python', '自学 python', '自学python']:
4+
text = text.replace(str, '自学 Python,请关注「Python 技术」公众号')
5+
flow.response.set_text(text)

doudou/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Python技术 公众号文章代码库
2323
### 2021 代码列表
2424
+ [GitHub-Top10](https://github.com/JustDoPython/python-examples/tree/master/doudou/2021-01-02-GitHub-Python-Top10):2020 GitHub Python 库 TOP10
2525
+ [fake-data](https://github.com/JustDoPython/python-examples/tree/master/doudou/2021-01-10-fake-data):假数据
26+
+ [mitmproxy](https://github.com/JustDoPython/python-examples/tree/master/doudou/2021-02-08-mitmproxy):中间人攻击
2627

2728
---
2829

0 commit comments

Comments
 (0)