-
Notifications
You must be signed in to change notification settings - Fork 79
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
feat(cluster): support HTTP(S) proxy for cluster readiness & OIDC config #365
Conversation
68e1178
to
fbaa218
Compare
return new https.Agent({ | ||
// Cached sessions can result in the certificate not being | ||
// available since its already been "accepted." Disable caching. | ||
maxCachedSessions: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we not pass this to HttpsProxyAgent
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HttpsProxyAgent
uses the HTTP CONNECT
method which is not cacheable.
maxCachedSessions
only exists in https.Agent
, it's not an HttpsProxyAgent
option or an option on either net.connect() & tls.connect() per: https://github.com/TooTallNate/node-https-proxy-agent#api
@@ -18,7 +18,8 @@ | |||
"netmask": "^1.0.6", | |||
"@types/js-yaml": "^3.12.0", | |||
"js-yaml": "^3.13.0", | |||
"which": "^1.3.1" | |||
"which": "^1.3.1", | |||
"https-proxy-agent": "^5.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have any types? (Or is out use of it weakly typed in the code?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has HttpsAgentOptions
but we do not make use of it. We only use the exported HttpsProxyAgent
which maps to the func createHttpsProxyAgent()
that picks between a string
or HttpsAgentOptions
. We use the common string
approach
https://github.com/TooTallNate/node-https-proxy-agent/blob/master/src/index.ts#L8-L12
Users in a proxied environment are unable to create and configure clusters, as HTTP requests made by Node during install and setup are not being properly routed to the proxy first. Using a proxy is now supported by either setting the standard proxy environment variables (`HTTP(S)_PROXY` and/or `http(s)_proxy`), or alternatively by specifying the `proxy: string` property in the cluster definition with the settings to use. Format: `<protocol>://<host>:<port>` Auth Format: `<protocol>://<username>:<password>@<host>:<port>` Ex: - `"http://proxy.example.com:3128"` - `"https://proxy.example.com"` - `"http://username:password@proxy.example.com:3128"` Support for both cluster and OIDC examples was tested using a local Squid v3.5 proxy server [running in Docker.](https://hub.docker.com/r/metral/squid)
fbaa218
to
8f82880
Compare
Proposed changes
Users in a proxied environment are unable to create and configure clusters,
as HTTP requests made by Node during install and setup are not being properly
routed to the proxy first.
Using a proxy is now supported by either setting the conventional proxy environment
variables (
HTTP(S)_PROXY
and/orhttp(s)_proxy
), or alternatively byspecifying the
proxy: string
property in the cluster definition with thesettings to use.
Format:
<protocol>://<host>:<port>
Auth Format:
<protocol>://<username>:<password>@<host>:<port>
Ex:
"http://proxy.example.com:3128"
"https://proxy.example.com"
"http://username:password@proxy.example.com:3128"
Support for both cluster and OIDC examples was tested using a local Squid v3.5
proxy server running in Docker.
Related issues (optional)
Closes #350