google-complete-me icon indicating copy to clipboard operation
google-complete-me copied to clipboard

Proxy problem

Open marekkaczkowski opened this issue 7 years ago • 1 comments

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 avatar Jan 12 '18 11:01 marekkaczkowski

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.

marekkaczkowski avatar Jan 16 '18 11:01 marekkaczkowski