teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

あささ

2020/08/19 05:10

投稿

m8354825717
m8354825717

スコア20

title CHANGED
File without changes
body CHANGED
@@ -66,4 +66,38 @@
66
66
 
67
67
  ### 詳しい方ご教授ください。
68
68
 
69
- ここにより詳細な情報を記載してください。
69
+ ここにより詳細な情報を記載してください。
70
+
71
+
72
+
73
+
74
+ # 追記
75
+ ```
76
+ try:
77
+ os.environ['NO_PROXY'] = '127.0.0.1'
78
+ os.environ["HTTP_PROXY"] = "http://127.0.0.1:8082"
79
+ os.environ["HTTPS_PROXY"] = "https://127.0.0.1:8082"
80
+
81
+ proxies = {
82
+ 'http': 'http://127.0.0.1:8082',
83
+ 'https': 'http://127.0.0.1:8082',
84
+ }
85
+ response = requests.get(
86
+ 'http://127.0.0.1:8082/api/', proxies=proxies, stream=True, timeout=(3.0, 7.5))
87
+ except requests.exceptions.RequestException as e:
88
+ logging.getLogger("error_logger").error(str(e))
89
+ return []
90
+ else:
91
+ print('Success')
92
+ return(res.status_code)
93
+ finally:
94
+ pass
95
+ ```
96
+
97
+ プロキシ設定してもダメでした。
98
+
99
+ エラ〜ログですが。
100
+ ```
101
+ HTTPConnectionPool(host='127.0.0.1', port=8082): Read timed out. (read timeout=7.5)
102
+ ```
103
+ が出ています。