How to configure VPN?
See original GitHub issueHello,
Before I introduce my problem, I would like to make a short preview about how the problem happened. Recently I have come to China. I know there is a firewall in this country, so I bought a VPN to help me deal with the banning problem. After I applied the method of using proxy IP, it raised the error as below. I have checked out the #2522 and #4540, but I found the error responses are different. And I cannot solve the problem. Please lead me to solve the problem. Thanks~
- OS: windows 10
- Programming Language version: python 3.7
- CCXT version: 1.28.85
- VPN: Express
exchange = ccxt.binance({
'proxies': {
'http': 'http://45.135.186.113:49665',
'https': 'https://45.135.186.113:49665',
},
})
markets = exchange.load_markets()
print(markets)
Traceback (most recent call last):
File "C:\Users\subao\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connection.py", line 171, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "C:\Users\subao\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\connection.py", line 79, in create_connection
raise err
File "C:\Users\subao\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\connection.py", line 69, in create_connection
sock.connect(sa)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ".\Python37\lib\site-packages\urllib3\connectionpool.py", line 594, in urlopen
self._prepare_proxy(conn)
File ".\Python37\lib\site-packages\urllib3\connectionpool.py", line 815, in _prepare_proxy
conn.connect()
File ".\Python37\lib\site-packages\urllib3\connection.py", line 314, in connect
conn = self._new_conn()
File ".\Python37\lib\site-packages\urllib3\connection.py", line 176, in _new_conn
(self.host, self.timeout))
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.VerifiedHTTPSConnection object at 0x000001FFEE28F240>, 'Connection to 45.135.186.113 timed out. (connect timeout=10)')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ".\Python37\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File ".\Python37\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File ".\Python37\lib\site-packages\urllib3\util\retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.binance.com', port=443): Max retries exceeded with url: /api/v3/exchangeInfo (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x000001FFEE28F240>, 'Connection to 45.135.186.113 timed out. (connect timeout=10)'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ".\Python37\lib\site-packages\ccxt\base\exchange.py", line 548, in fetch
verify=self.verify
File ".\Python37\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File ".\Python37\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File ".\Python37\lib\site-packages\requests\adapters.py", line 504, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.binance.com', port=443): Max retries exceeded with url: /api/v3/exchangeInfo (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x000001FFEE28F240>, 'Connection to 45.135.186.113 timed out. (connect timeout=10)'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./timezone_adj.py", line 15, in <module>
markets = exchange.load_markets()
File ".\Python37\lib\site-packages\ccxt\base\exchange.py", line 1298, in load_markets
markets = self.fetch_markets(params)
File ".\Python37\lib\site-packages\ccxt\binance.py", line 386, in fetch_markets
response = getattr(self, method)(query)
File ".\Python37\lib\site-packages\ccxt\base\exchange.py", line 449, in inner
return entry(_self, **inner_kwargs)
File ".\Python37\lib\site-packages\ccxt\binance.py", line 1928, in request
response = self.fetch2(path, api, method, params, headers, body)
File ".\site-packages\ccxt\base\exchange.py", line 468, in fetch2
return self.fetch(request['url'], request['method'], request['headers'], request['body'])
File ".\site-packages\ccxt\base\exchange.py", line 568, in fetch
raise RequestTimeout(method + ' ' + url)
ccxt.base.errors.RequestTimeout: GET https://api.binance.com/api/v3/exchangeInfo
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How To Set Up A VPN On Any Device - Forbes
Use the Windows Store or internet to download a VPN app. · Move into “Settings” and click on “Network” and then “VPN.” ·...
Read more >How to Set Up and Use a VPN - PCMag
A VPN is an easy way to improve your privacy online. We break down what they do, how to pick the best fit...
Read more >How to Set Up and Install a VPN - Security.org
1. Make sure the router you plan to use as a VPN server has an integrated VPN server functionality. VPN server functionality should...
Read more >How to Install a VPN Connection - Business News Daily
Open Settings in your Android device. · Find Wireless and Networks and click More. · Select VPN and follow it up by tapping...
Read more >How to set up a VPN for increased security and privacy
Click on the Windows button, then head into “Settings” > “Network & Internet” > “VPN.” Click on “Add a VPN connection.” · In...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I solved the problem by applying the method that you mentioned. Thank you so much! @kroitor 👍
@mick-liu if you’re using ExpressVPN, this might help: https://www.google.com/search?q=how+to+configure+expressvpn+windows+10, usually you get the instructions upon signing up with the VPN provider. I’d close this issue for now since it’s not really an issue with CCXT. It’s more about the VPN configuration that depends on your OS and on your VPN provider. Feel free to reopen it if needed or just ask further questions if any. We will be thankful for your feedback, let us know if you have a followup on this.