PyProxy/example.py
2024-11-29 16:31:32 +08:00

15 lines
310 B
Python

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()