Open whg517 opened 6 years ago
https://github.com/SpiderClub/haipproxy/blob/9e11cdeb71a209f0ec3db05c67351de42acbd7b8/haipproxy/api/core.py#L22
因为 ProxyFetcher('task') 传入为字符串'task' 。
ProxyFetcher('task')
'task'
https://github.com/SpiderClub/haipproxy/blob/9e11cdeb71a209f0ec3db05c67351de42acbd7b8/haipproxy/client/py_cli.py#L112 在判断不在 sorce_map 中会赋值为 https https://github.com/SpiderClub/haipproxy/blob/9e11cdeb71a209f0ec3db05c67351de42acbd7b8/haipproxy/client/py_cli.py#L114
sorce_map
https
所以这里逻辑有点问题。正确获取对应 usage 的 proxy 应该是
- usage_registry = {task['name']: ProxyFetcher('task') for task in VALIDATOR_TASKS} + usage_registry = {task['name']: ProxyFetcher(task['name']) for task in VALIDATOR_TASKS}
https://github.com/SpiderClub/haipproxy/blob/9e11cdeb71a209f0ec3db05c67351de42acbd7b8/haipproxy/api/core.py#L58
使用这个接口的方式应该是
http://127.0.0.1:5000/proxy/delete/zhihu/http://1.63.153.153:80
但是很明显这个 URL 是有问题的 对于 proxy 参数,如果要正常传入应该在 request body 中发送。
proxy
建议优化接口参数接收方式和数据接收方式。
感谢指出错误。 api这个功能目前还在开发中,master上的东西并不是稳定的。目前精力不是很够,所以一直没更新,api这里最大的问题还是在于多个用户的IP使用隔离机制,这一点也还在探索之中
1. api 获取代理全部为 https 的代理
https://github.com/SpiderClub/haipproxy/blob/9e11cdeb71a209f0ec3db05c67351de42acbd7b8/haipproxy/api/core.py#L22
因为
ProxyFetcher('task')
传入为字符串'task'
。https://github.com/SpiderClub/haipproxy/blob/9e11cdeb71a209f0ec3db05c67351de42acbd7b8/haipproxy/client/py_cli.py#L112 在判断不在
sorce_map
中会赋值为https
https://github.com/SpiderClub/haipproxy/blob/9e11cdeb71a209f0ec3db05c67351de42acbd7b8/haipproxy/client/py_cli.py#L114所以这里逻辑有点问题。正确获取对应 usage 的 proxy 应该是
2. delete 接口参数设置错误
https://github.com/SpiderClub/haipproxy/blob/9e11cdeb71a209f0ec3db05c67351de42acbd7b8/haipproxy/api/core.py#L58
使用这个接口的方式应该是
但是很明显这个 URL 是有问题的 对于
proxy
参数,如果要正常传入应该在 request body 中发送。建议优化接口参数接收方式和数据接收方式。