PyProxy/example.py

15 lines
310 B
Python
Raw Normal View History

2024-11-29 16:31:32 +08:00
import requests
def main():
# 配置代理
proxies = {
'http': 'socks5://localhost:8888',
'https': 'socks5://localhost:8888'
}
# 发送HTTP请求
response = requests.get('http://example.com', proxies=proxies)
print(response.text)
if __name__ == '__main__':
main()