File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1+ from flask import Flask
2+ import requests
3+
4+ app = Flask (__name__ )
5+
6+
7+ @app .route ('/' )
8+ def index ():
9+ req = requests .get ('http://127.0.0.1:5000/proxy' )
10+ return req .text
11+
12+
13+ @app .route ('/proxy' )
14+ def proxy ():
15+ return "Hello Flask."
16+
17+
18+ if __name__ == '__main__' :
19+ app .run ('0.0.0.0' , debug = True )
Original file line number Diff line number Diff line change 222220 . [ flask-apscheduler] ( https://xugaoxiang.com/2020/10/08/flask-20-apscheduler/ )
232321 . [ 添加favicon] ( https://xugaoxiang.com/2020/11/11/flask-21-favicon/ )
242422 . [ 在浏览器中播放rtsp实时流] ( https://xugaoxiang.com/2020/11/12/flask-22-opencv-rtsp/ )
25- 23 . [ 简单异步任务] ( https://xugaoxiang.com/2020/11/16/flask-23-threadpoolexecutor/ )
25+ 23 . [ 简单异步任务] ( https://xugaoxiang.com/2020/11/16/flask-23-threadpoolexecutor/ )
26+ 24 . [ http请求转发] ( https://xugaoxiang.com/2020/11/24/flask-24-http-proxy/ )
You can’t perform that action at this time.
0 commit comments