forked from jaywcjlove/reference
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
71 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
ps | ||
=== | ||
|
||
这是开始使用 PS 命令快速参考备忘单,可以帮助用户更高效地浏览网页 | ||
|
||
入门 | ||
---- | ||
## 查看 进程运行 时长 | ||
|
||
```bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
mitmproxy | ||
=== | ||
|
||
## MacOS 安装 | ||
```bash | ||
brew install --cask mitmproxy --verbose | ||
``` | ||
|
||
## 证书 | ||
``` | ||
~/.mitmproxy/ | ||
``` | ||
|
||
## 例子 | ||
```python | ||
|
||
# -*- coding:utf-8 -*- | ||
|
||
from mitmproxy import ctx | ||
# from save_mongo import save_task | ||
import json | ||
|
||
def response(flow): | ||
"""获取粉丝数据""" | ||
print("debug------") | ||
urls = [ | ||
"xxx/use", | ||
"/yyyy", | ||
"/eeee", | ||
"/ddd", | ||
"/cccc", | ||
] | ||
|
||
for u in urls: | ||
if u in flow.request.url: | ||
# 修复状态码 | ||
if flow.response.status_code == 400: | ||
flow.response.status_code = 200 | ||
|
||
# 修复 JSON 结构 | ||
data = { | ||
"code": 200, | ||
"message": "success" | ||
} | ||
|
||
# 返回修复后的响应 | ||
flow.response.content = json.dumps(data).encode('utf-8') | ||
return response | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters