python应用程序的简单代理身份验证
proxyauth的Python项目详细描述
python应用程序的代理身份验证
注意:此软件包仍处于测试阶段。小心使用!
快速启动
安装ProxyAuth:
pip install proxyauth
使用代理:
app=Flask(__name__)app.config['SECRET_KEY']='helloworld'app.config['PERMANENT_SESSION_LIFETIME']=timedelta(days=7)# app.config['SESSION_COOKIE_HTTPONLY'] = True@proxy_all(app=app,auth_url='http://127.0.0.1:7000')defproxy(path):returnrequest.url.replace(':7001',':7002')@app.route('/error',methods=['GET'])defcookie():return'error'@app.route('/session',methods=['GET'])defsetup():returnsession_setup()if__name__=='__main__':app.run(port=7001)