LangChain is the most popular framework for building LLM applications. Its web browsing tools, search integrations, and agent capabilities all benefit from mobile proxy infrastructure for reliable, unblocked access.
These LangChain components make web requests and benefit from mobile proxy routing.
GoogleSearchAPIWrapper, DuckDuckGoSearchRun, BingSearchAPIWrapper
Search engines rate-limit and block automated queries. Mobile IPs appear as real users.
WebBaseLoader, AsyncHtmlLoader, PlaywrightURLLoader
Websites block datacenter IPs. Mobile proxies ensure reliable page loading.
RequestsGetTool, RequestsPostTool, SeleniumURLLoader
API endpoints and dynamic sites need clean IPs for consistent access.
ArxivLoader, WikipediaLoader, PubMedLoader
Academic and reference sites implement rate limiting that mobile IPs bypass.
WebResearchRetriever, TavilySearchAPIRetriever
Research agents making many requests need rotating mobile IPs.
PlaywrightBrowserToolkit, SeleniumToolkit
Full browser automation requires mobile IPs for anti-bot bypass.
import os
# Set proxy for all requests-based LangChain tools
os.environ["HTTP_PROXY"] = "socks5://user:pass@proxy.proxies.sx:10001"
os.environ["HTTPS_PROXY"] = "socks5://user:pass@proxy.proxies.sx:10001"
from langchain_community.tools import DuckDuckGoSearchRun
from langchain_community.document_loaders import WebBaseLoader
# Tools now use mobile proxy automatically
search = DuckDuckGoSearchRun()
result = search.run("latest AI news")
loader = WebBaseLoader("https://example.com")
docs = loader.load()import requests
from langchain_community.document_loaders import WebBaseLoader
# Create proxied session
session = requests.Session()
session.proxies = {
"http": "socks5://user:pass@proxy.proxies.sx:10001",
"https": "socks5://user:pass@proxy.proxies.sx:10001"
}
# Use session with WebBaseLoader
loader = WebBaseLoader(
"https://example.com",
session=session,
requests_kwargs={"timeout": 30}
)
docs = loader.load()from langchain_community.agent_toolkits import PlaywrightBrowserToolkit
from langchain_community.tools.playwright.utils import create_async_playwright_browser
# Create browser with proxy
async def get_proxied_browser():
browser = await create_async_playwright_browser(
headless=True,
proxy={
"server": "socks5://proxy.proxies.sx:10001",
"username": "your_username",
"password": "your_password"
}
)
return browser
# Use with toolkit
browser = await get_proxied_browser()
toolkit = PlaywrightBrowserToolkit.from_browser(async_browser=browser)
tools = toolkit.get_tools()import os
os.environ["HTTP_PROXY"] = "socks5://user:pass@proxy.proxies.sx:10001"
os.environ["HTTPS_PROXY"] = "socks5://user:pass@proxy.proxies.sx:10001"
from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_react_agent
from langchain_community.tools import DuckDuckGoSearchRun
from langchain import hub
# Initialize LLM
llm = ChatOpenAI(model="gpt-4", temperature=0)
# Get search tool (now proxied)
search_tool = DuckDuckGoSearchRun()
tools = [search_tool]
# Create ReAct agent
prompt = hub.pull("hwchase17/react")
agent = create_react_agent(llm, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
# Run agent - all web requests go through mobile proxy
result = agent_executor.invoke({
"input": "What are the top AI companies in 2025?"
})Set environment variables before importing LangChain modules. Some loaders initialize HTTP clients at import time.
AsyncHtmlLoader and async tools handle multiple requests efficiently. Combine with proxy rotation for high-volume scraping.
Even with mobile proxies, some requests fail. Use LangChain's built-in retry mechanisms and rotate IPs on persistent failures.
Use LangChain's caching to avoid redundant web requests. This saves bandwidth costs and reduces detection risk.
Get reliable web access for LangChain tools with real mobile IPs.