15 lines
310 B
Python
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()
|