Huachao / vscode-restclient

REST Client Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
MIT License
5.24k stars 436 forks source link

Not working through corporate NTLM proxy #152

Open chengkiang opened 6 years ago

chengkiang commented 6 years ago

Not working with NTLM proxy nor with CNTLM.

Steps to Reproduce:

  1. Open a new VSCode session, set language to HTTP.
  2. Enter a URL, e.g. https://httpbin.org/ip
  3. Press Ctrl-Alt-R.

Error message: tunneling socket could not be established, cause=socket hang up

Setting the corporate NTLM proxy directly into the VSCode settings gives a different error: tunneling socket could not be established, statusCode=407

Relevant VSCode settings:

When using direct proxy URL: { "http.proxy": "http://domain%5Cmyusername:password@proxy.domain:8080", "http.proxyStrictSSL": false }

When using CNTLM: { "http.proxy": "http://localhost:3128", "http.proxyStrictSSL": false }

VSCode Extensions seem to work fine, so the VSCode proxy settings are probably correct. I have the same CNTLM proxy set in my npm as well, and npm is working fine too. Just VSCode REST client is having some trouble.

Huachao commented 6 years ago

@chengkiang this is a limitation of the underlying request library, which support Basic Auth proxy only. I will consider how I can workaround for this. And can you show me the error response to help me to investigate.

chengkiang commented 6 years ago

@Huachao How can I get more detailed error messages for you? The CNTLM is supposed to let non-NTLM-aware apps access a NTLM-based proxy, somehow it doesn't work here. It also doesn't work with Postman. So for debugging REST I am left with curl now. :(

Huachao commented 6 years ago

@chengkiang as you said previously, the server returned 407 to my extension, I guess the error origins from https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization, so I think the error still comes from my dependent request library doesn't support non-Basic proxy authentication.

XobSod commented 5 years ago

Hi, Do you have any workaround for this? I have the same issue :/