Skip to content

Commit

Permalink
Support global-agent for central proxy configuration (FlowiseAI#3423)
Browse files Browse the repository at this point in the history
* * Added global-agent as central Global HTTP/HTTPS proxy configurable using environment variable
**  https://www.npmjs.com/package/global-agent
* Server-Bootstrap on index.js
** import 'global-agent/bootstrap'
* added dep in package.json
** global-agent: "^3.0.0

* * Added global-agent as central Global HTTP/HTTPS proxy configurable using environment variable
**  Added env variables

* update env example

* update env and lock file

* update env and lock file

---------

Co-authored-by: Henry <[email protected]>
  • Loading branch information
akoo24 and HenryHengZJ authored Nov 1, 2024
1 parent 598f9a6 commit d9bf612
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 2 deletions.
8 changes: 7 additions & 1 deletion docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ BLOB_STORAGE_PATH=/root/.flowise/storage
# S3_FORCE_PATH_STYLE=false

# APIKEY_STORAGE_TYPE=json (json | db)
# SHOW_COMMUNITY_NODES=true
# SHOW_COMMUNITY_NODES=true

# Uncomment the following lines to enable global agent proxy
# see https://www.npmjs.com/package/global-agent for more details
# GLOBAL_AGENT_HTTP_PROXY=CorporateHttpProxyUrl
# GLOBAL_AGENT_HTTPS_PROXY=CorporateHttpsProxyUrl
# GLOBAL_AGENT_NO_PROXY=ExceptionHostsToBypassProxyIfNeeded
6 changes: 6 additions & 0 deletions packages/server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ PORT=3000

# APIKEY_STORAGE_TYPE=json (json | db)
# SHOW_COMMUNITY_NODES=true

# Uncomment the following lines to enable global agent proxy
# see https://www.npmjs.com/package/global-agent for more details
# GLOBAL_AGENT_HTTP_PROXY=CorporateHttpProxyUrl
# GLOBAL_AGENT_HTTPS_PROXY=CorporateHttpsProxyUrl
# GLOBAL_AGENT_NO_PROXY=ExceptionHostsToBypassProxyIfNeeded
3 changes: 2 additions & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
"sqlite3": "^5.1.6",
"typeorm": "^0.3.6",
"uuid": "^9.0.1",
"winston": "^3.9.0"
"winston": "^3.9.0",
"global-agent": "^3.0.0"
},
"devDependencies": {
"@types/content-disposition": "0.5.8",
Expand Down
1 change: 1 addition & 0 deletions packages/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import flowiseApiV1Router from './routes'
import errorHandlerMiddleware from './middlewares/errors'
import { SSEStreamer } from './utils/SSEStreamer'
import { validateAPIKey } from './utils/validateKey'
import 'global-agent/bootstrap'

declare global {
namespace Express {
Expand Down
67 changes: 67 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d9bf612

Please sign in to comment.