* fix proxy.md Signed-off-by: jiangying <krivergo3@gmail.com> * Update proxy.md Signed-off-by: jiangying <krivergo3@gmail.com> --------- Signed-off-by: jiangying <krivergo3@gmail.com>
34 lines
734 B
Markdown
34 lines
734 B
Markdown
- [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(
|
|
hosts=["https://..."],
|
|
use_ssl=True,
|
|
verify_certs=True,
|
|
connection_class=RequestsHttpConnection,
|
|
trust_env=True,
|
|
)
|
|
```
|
|
|
|
## Using a Proxy with an Async Client
|
|
|
|
```python
|
|
from opensearchpy import AsyncOpenSearch, AIOHttpConnection
|
|
|
|
client = AsyncOpenSearch(
|
|
hosts=["https://..."],
|
|
use_ssl=True,
|
|
verify_certs=True,
|
|
connection_class=AIOHttpConnection,
|
|
trust_env=True,
|
|
)
|
|
```
|