LangChain
LangChain pipelines that fetch web content (loaders, retrievers, web-search tools) can route through helodata to avoid IP-based blocks during LLM-driven scraping or RAG ingestion.
Document loaders
WebBaseLoader, PlaywrightURLLoader, and friends use requests / httpx / Playwright under the hood. Set the proxy on the underlying client.
WebBaseLoader
from langchain_community.document_loaders import WebBaseLoader
USER = "helo_s1a2b3c4d5e-type-res-region-us"
PASS = "PASSWORD"
proxy = f"http://{USER}:{PASS}@gate.helodata.io:7777"
loader = WebBaseLoader("https://example.com")
loader.requests_kwargs = {
"proxies": {"http": proxy, "https": proxy},
"timeout": 30,
}
docs = loader.load()PlaywrightURLLoader
Web search tools
Tools like TavilySearch or DuckDuckGoSearchRun hit external APIs that may or may not need proxying. For tools backed by HTTP scraping (e.g. RequestsGetTool), inject the proxied client:
Sticky session per LLM call
LangChain agents often make multiple sub-requests during one chain. Use a sticky session so the target sees consistent IP behaviour:
Re-use proxy across all sub-requests within the chain.
Tagging for analytics
Pass X-Helodata-Tag in headers to separate LLM-driven traffic from your other scraping:
Common pitfalls
UnstructuredURLLoaderignores proxies in some versions — switch toWebBaseLoaderor pre-download withrequests.Async loaders — wrap the client in
httpx.AsyncClient(proxy=proxy)for proxy support;aiohttpusesproxy=per request.
Last updated
Was this helpful?