Files

34 lines
734 B
Markdown
Raw Permalink Normal View History

- [Using a Proxy](#using-a-proxy)
- [Using a Proxy with a Sync Client](#using-a-proxy-with-a-sync-client)
- [Using a Proxy with an Async Client](#using-a-proxy-with-an-async-client)
# Using a Proxy
## Using a Proxy with a Sync Client
```python
from opensearchpy import OpenSearch, RequestsHttpConnection
OpenSearch(
2024-10-24 01:58:08 +08:00
hosts=["https://..."],
use_ssl=True,
verify_certs=True,
2024-10-24 01:58:08 +08:00
connection_class=RequestsHttpConnection,
trust_env=True,
)
```
## Using a Proxy with an Async Client
```python
from opensearchpy import AsyncOpenSearch, AIOHttpConnection
client = AsyncOpenSearch(
2024-10-24 01:58:08 +08:00
hosts=["https://..."],
use_ssl=True,
verify_certs=True,
connection_class=AIOHttpConnection,
trust_env=True,
)
2024-10-24 01:58:08 +08:00
```