Skip to content

feat: Add HTTP proxy for supported LLM nodes #15449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

OlegIvaniv
Copy link
Contributor

Summary

This PR adds HTTP proxy support to LangChain LLM nodes by implementing a new getHttpProxyAgent utility function that respects standard proxy environment variables (HTTP_PROXY, HTTPS_PROXY)

Changes include:

  • Add new httpProxyAgent.ts utility to check for proxy environment variables
  • Add comprehensive unit tests for the proxy agent functionality
  • Add https-proxy-agent package dependency (v7.0.6)
  • Implement proxy agent in LLM nodes including Anthropic, OpenAI, AWS Bedrock, Azure, Groq, and OpenRouter

Related Linear tickets, Github issues, and Community forum posts

closes #10901

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@OlegIvaniv OlegIvaniv requested a review from ggozad May 16, 2025 07:52
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mrge reviewed 13 files and found no issues. Review PR in mrge.io.

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label May 16, 2025
@ggozad
Copy link
Contributor

ggozad commented May 16, 2025

Are we missing some providers? Ollama for example.

@OlegIvaniv OlegIvaniv requested a review from ggozad May 16, 2025 09:25
@OlegIvaniv
Copy link
Contributor Author

OlegIvaniv commented May 16, 2025

Are we missing some providers? Ollama for example.
@ggozad Not all LLM proviers support custom httpAgent. I updated the order to prioritize HTTPS proxy. Can you have another look, pls?

Copy link
Contributor

@ggozad ggozad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🤩

Copy link
Contributor

✅ All Cypress E2E specs passed

@OlegIvaniv OlegIvaniv merged commit 907485d into master May 16, 2025
33 checks passed
@OlegIvaniv OlegIvaniv deleted the ai-357-community-issue-langchain-nodes-not-respecting-http-proxy branch May 16, 2025 10:23
@kent-1
Copy link

kent-1 commented May 16, 2025

Awesome, can you also make the same for Gemini please ??

As always good job guys.

@github-actions github-actions bot mentioned this pull request May 19, 2025
@janober
Copy link
Member

janober commented May 19, 2025

Got released with [email protected]

ozcangungor pushed a commit to ozcangungor/n8n that referenced this pull request May 25, 2025
etobella pushed a commit to etobella/n8n that referenced this pull request May 25, 2025
Alexandero89 pushed a commit to Alexandero89/n8n that referenced this pull request May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Langchain nodes not respecting HTTP proxy settings
4 participants