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

Inject VS Code proxy settings into JVM args #449

Merged

Conversation

datho7561
Copy link
Contributor

@datho7561 datho7561 commented 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, 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

@datho7561 datho7561 force-pushed the 416-inject-proxy-config branch 2 times, most recently from daa021c to 1cdc71a Compare April 6, 2021 19:15
@datho7561 datho7561 marked this pull request as ready for review April 6, 2021 19:20
src/server/binary/binaryServerStarter.ts Outdated Show resolved Hide resolved
src/settings/settings.ts Outdated Show resolved Hide resolved
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 force-pushed the 416-inject-proxy-config branch from 1cdc71a to cbfcc62 Compare April 6, 2021 19:29
@datho7561 datho7561 requested a review from rgrunber April 12, 2021 17:09
Copy link
Member

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

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

I've tested this out and seem like values are being passed to the language server for the Java and Binary cases, so this seems fine to me.

Feel free to merge when ready.

@datho7561 datho7561 merged commit ff795ff into redhat-developer:master Apr 12, 2021
@datho7561 datho7561 deleted the 416-inject-proxy-config branch April 12, 2021 20:35
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.

Respect http.proxy and http.proxyAuthorization settings
2 participants