markdown-link-check icon indicating copy to clipboard operation
markdown-link-check copied to clipboard

Proxy configuration

Open ricovitch opened this issue 3 years ago • 8 comments

Hi,

I'd like to use this tool behind a corporate proxy, and I don't get how to configure the proxy, if possible. I checked internal through link-check and needle.

I thought from reading at this issue that would be possible https://github.com/tcort/link-check/issues/29

Looking at needle documentation we would have to pass a proxy or agent option for that : https://github.com/tomas/needle#request-options

Currently there does not seem to be an option in order to configure a proxy, or am I missing something ?

ricovitch avatar Jul 08 '21 15:07 ricovitch

same here, it seems not to work behind proxy even with http(s)_proxy variables defined

btel avatar Oct 08 '21 12:10 btel

Hi @tcort, I tried to move this topic upstream for full support in needle itself e.g. including no_proxy, in https://github.com/tomas/needle/pull/382, as using the standard environment variables is usually the way to go. But that doesn't seem to be picking up - would you still be interested in doing this on the link-check side? It does seem like the older request library already had full support for this https://github.com/request/request/blob/3c0cddc7c8eb60b470e9519da85896ed7ee0081e/README.md?plain=1#L568-L578

nejch avatar Jan 24 '22 12:01 nejch

The PR against needle seems to be merged in upstream release 3.1.0 (https://github.com/tomas/needle/commit/8353cdb5163a3e8e610ccc1eaea4e604c5159401).

A corresponding dependency bump would be needed to turn it effective for markdown-link-check.

fhaftmann avatar Apr 26 '22 08:04 fhaftmann

@fhaftmann you can already bump needle yourself as markdown-link-check does not pin it to the exact version: https://github.com/tcort/markdown-link-check/blob/master/package.json#L42

However, the implementation of no_proxy in that PR only seems to cover exact hosts, but not domains or ports (see discussion in https://github.com/tomas/needle/issues/383), so not sure that'll fix the issue for you entirely.

nejch avatar Apr 26 '22 08:04 nejch

However, the implementation of no_proxy in that PR only seems to cover exact hosts, but not domains or ports (see discussion in https://github.com/tomas/needle/issues/383), so not sure that'll fix the issue for you entirely.

Confirmed => only way to support http_proxy / https_proxy / no_proxy is to use/downgrade markdown-link-check to 3.8.7 😢

axel3rd avatar Sep 23 '22 09:09 axel3rd

I can also confirm. No matter how I set https_proxy I get only errors 502 and 503 for external URLs. With 3.8.7 there are no problems. Verbose output -v does not show more information.

dklimpel avatar Dec 30 '22 11:12 dklimpel

IMO the problem is an upstream bug: https://github.com/tomas/needle/issues/406

dklimpel avatar Dec 29 '23 11:12 dklimpel