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

Proxy problem #5

Open
marekkaczkowski opened this issue Jan 12, 2018 · 1 comment
Open

Proxy problem #5

marekkaczkowski opened this issue Jan 12, 2018 · 1 comment

Comments

@marekkaczkowski
Copy link

Hey,
Looks like proxy settings are not handled by google-complete-me.
Due to that I'm getting error:

[jaydenlin.google-complete-me]request to http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=warsz failed, reason: getaddrinfo ENOTFOUND suggestqueries.google.com suggestqueries.google.com:80

@marekkaczkowski
Copy link
Author

marekkaczkowski commented Jan 16, 2018

Fixed with HttpsProxyAgent and additional configuration for node-fetch:
extensions.js:CompleteProvider.prototype.provideCompletionItems

fetch('http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=' + getUserKeyIn(lineText, position), {
  agent: process.env.HTTP_PROXY != '' ? new HttpsProxyAgent(process.env.HTTP_PROXY) : null,
  timeout: 10000 // It would be nice to set it in VS Code settings
})

I'll fork your repo and create pull req.

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

No branches or pull requests

1 participant