Skip to content
This repository was archived by the owner on Dec 24, 2020. It is now read-only.

Can't install LS behind http proxy #160

Open
borisbrodski opened this issue Apr 1, 2020 · 3 comments · May be fixed by #171
Open

Can't install LS behind http proxy #160

borisbrodski opened this issue Apr 1, 2020 · 3 comments · May be fixed by #171

Comments

@borisbrodski
Copy link

Reproduction:

  • In environment behind http proxy (without authentication)
  • Install NeoVIM
  • Install Coc
  • Create coc-settings.json with
    {
	"http.proxy": "myproxy:8080"
    }
  • :CocInstall coc-python
  • Update coc-settings.json to
    {
	"python.jediEnabled": false,
	"http.proxy": "myproxy:8080"
    }
  • Open .py file
  • Press {Space}c for list of coc-command, then choose python.upgradePythonLanguageServer

Error:

[coc.nvim]Command error: tunneling socket could not be established, cause=read ECONNRESET
@borisbrodski
Copy link
Author

Any workaround is appreciated! Thank you.

@kentac55
Copy link

related issue: neoclide/coc.nvim#1382

To use python.upgradePythonLanguageServer behind http proxy, you need two steps:

  1. Set environment variables: http_proxy and https_proxy with scheme(ex: export http_proxy=http://myproxy:8080 && export https_proxy=http://myproxy:8080
  2. Set http.proxy in coc-settings.json with scheme like as below:
{
    "http.proxy": "http://myproxy:8080"
}

remember, both configs need scheme!

BTW, request loads proxy address from environment variables by default. I think this code removes it.

https://github.com/neoclide/coc-python/blob/master/src/common/net/httpClient.ts#L15

FYI, coc.nvim uses npm directry so this problem doesn't reproduce.

https://github.com/neoclide/coc.nvim/blob/master/src/model/extension.ts#L90

@kentac55 kentac55 linked a pull request Apr 14, 2020 that will close this issue
@borisbrodski
Copy link
Author

Thank you very much!
This worked for me very well! Is it possible to add it at least to the GitHub Readme.md?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants