aiohttp request with proxy params in ccxt.async
See original GitHub issueHello.
I want to fetch orderbooks from bittrex using ccxt.async
through my proxy server.
I know that fetch_order_book
uses aiohttp
module in it, and I want to pass my proxy address to aiohttp.ClientSession().get()
as a parameter, as shown below.
async with aiohttp.ClientSession() as session:
async with session.get("http://python.org",
proxy="http://some.proxy.com") as resp:
print(resp.status)
So, I think I need to override fetch_order_book()
.
How do I get through this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:20 (11 by maintainers)
Top Results From Across the Web
Advanced Client Usage — aiohttp 3.8.3 documentation
Create the session first, use the instance for performing HTTP requests and initiating ... async def on_request_start( session, trace_config_ctx, params): ...
Read more >Exchanges — ccxt 2.4.71 documentation
An example of a proxy string is 'http://cors-anywhere.herokuapp.com/' . The absolute exchange endpoint URL is appended to this string before sending the HTTP ......
Read more >ccxt-dev/ccxt - Gitter
Hola @kroitor, I have a question regarding the python async exchange class. ... asyncio.ensure_future(self.session.close(), loop=self.asyncio_loop).
Read more >aiohttp ssl certificate_verify_failed - You.com | The AI Search ...
The CA file is working with cURL, Python Requests, but not aiohttp, ... ClientSession() as session: async with session.get(url, params=params) as resp: ...
Read more >ccxt Documentation - Read the Docs
https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support. # This is the setting you should be using with async version of ccxt ...
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 FreeTop 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
Top GitHub Comments
@kroitor Thank you 😃
@owneroxxor using an external session + socks connector could work:
The example code could look close to this:
Make sure you
await session.close()
when you don’t need it anymore.