Skip to content
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

Allow proxy configuration to be passed as environment variables #1012

Conversation

datho7561
Copy link
Contributor

Reads the proxy configuration from these env:

  • HTTP_PROXY_HOST
  • HTTP_PROXY_PORT
  • HTTP_PROXY_USERNAME
  • HTTP_PROXY_PASSWORD

A part of resolving redhat-developer/vscode-xml#416

Signed-off-by: David Thompson davthomp@redhat.com

Reads the proxy configuration from these env:
 * `HTTP_PROXY_HOST`
 * `HTTP_PROXY_PORT`
 * `HTTP_PROXY_USERNAME`
 * `HTTP_PROXY_PASSWORD`

A part of resolving redhat-developer/vscode-xml#416

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-xml that referenced this pull request Apr 6, 2021
Interprets the `http.proxyHost` and `http.proxyAuthorization` settings
in order to set up the JVM arguments or environment variables
in order to configure the proxy for the language server.

JVM arguments are used when running the Java server, and environment
variables are used when running the binary server.

This means if the proxy is configured through these settings in VS Code,
then vscode-xml will download schemas through the proxy.

While running the Java server,
if the proxy is already configured in `xml.server.vmargs`,
then the `http.proxyHost` and `http.proxyAuthorization` are ignored.

Limitations:
 * If `http.proxyAuthorization` is used, it is assumed to be
   [Basic authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization#directives),
   with a username/password pair, since the JVM expects a username/password pair.

Requires eclipse-lemminx/lemminx#1012

Closes redhat-developer#416

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-xml that referenced this pull request Apr 6, 2021
Interprets the `http.proxyHost` and `http.proxyAuthorization` settings
in order to set up the JVM arguments or environment variables
in order to configure the proxy for the language server.

JVM arguments are used when running the Java server, and environment
variables are used when running the binary server.

This means if the proxy is configured through these settings in VS Code,
then vscode-xml will download schemas through the proxy.

While running the Java server,
if the proxy is already configured in `xml.server.vmargs`,
then the `http.proxyHost` and `http.proxyAuthorization` are ignored.

Limitations:
 * If `http.proxyAuthorization` is used, it is assumed to be
   [Basic authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization#directives),
   with a username/password pair, since the JVM expects a username/password pair.

Requires eclipse-lemminx/lemminx#1012

Closes redhat-developer#416

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 merged commit c253b96 into eclipse-lemminx:master Apr 12, 2021
@datho7561 datho7561 deleted the 416-proxy-config-through-environment branch April 12, 2021 14:43
datho7561 added a commit to redhat-developer/vscode-xml that referenced this pull request Apr 12, 2021
Interprets the `http.proxyHost` and `http.proxyAuthorization` settings
in order to set up the JVM arguments or environment variables
in order to configure the proxy for the language server.

JVM arguments are used when running the Java server, and environment
variables are used when running the binary server.

This means if the proxy is configured through these settings in VS Code,
then vscode-xml will download schemas through the proxy.

While running the Java server,
if the proxy is already configured in `xml.server.vmargs`,
then the `http.proxyHost` and `http.proxyAuthorization` are ignored.

Limitations:
 * If `http.proxyAuthorization` is used, it is assumed to be
   [Basic authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization#directives),
   with a username/password pair, since the JVM expects a username/password pair.

Requires eclipse-lemminx/lemminx#1012

Closes #416

Signed-off-by: David Thompson <davthomp@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant