Page MenuHomeSoftware Heritage

proxy support for swh scanner
Closed, MigratedEdits Locked

Description

It would be nice if swh scanner scan supported using a proxy to connect to archive.softwareheritage.org.
Especially useful in environments where all access to the Internet is behind a proxy and the setup is via well-known environment variables that are used by all programs.

Fortunately, it's an easy fix:
In the creation of the HTTP session in https://forge.softwareheritage.org/source/swh-scanner/browse/master/swh/scanner/scanner.py$193 one has simply to pass an extra trust_env=True to the into aiohttp.ClientSession() constructor, as explained in the last paragraph of https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support