Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 734 Bytes

proxy.md

File metadata and controls

33 lines (26 loc) · 734 Bytes

Using a Proxy

Using a Proxy with a Sync Client

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

from opensearchpy import AsyncOpenSearch, AIOHttpConnection

client = AsyncOpenSearch(
    hosts=["https://..."],
    use_ssl=True,
    verify_certs=True,
    connection_class=AIOHttpConnection,
    trust_env=True,
)