In the yfinance API documented with network configuration, set the proxy before starting the workload:

import yfinance as yf

yf.config.network.proxy = 'http://proxy.example:8080' 

Continue with the application’s normal Ticker or download operations. An HTTP listener keeps an http URL even when the requested service is HTTPS. The HTTP proxy list provides candidates for this value when public-data requests may use a public intermediary.

This is process-wide library configuration. Avoid changing it between concurrent jobs that need different routes. The transport already owned by yfinance is the relevant consumer; configuring an unrelated requests.Session does not establish that yfinance uses it.

Older examples passed proxy to individual methods or used set_config(proxy=...). Check the installed API generation before mixing those forms with the current config object. The project’s source marks the set_config proxy argument deprecated in favor of config.network.proxy.

For SOCKS, match the URL scheme and DNS-resolution mode supported by the installed transport. Supplying a SOCKS endpoint as http does not convert its protocol.

Winndannde jowitiiɗe heen