nitter icon indicating copy to clipboard operation
nitter copied to clipboard

Enable using of configured http proxy for media

Open digletthat opened this issue 2 months ago • 4 comments

Currently, configured http proxy (Config.proxy, Config.proxy_auth) is only used for API calls. Media (twimg.com) is always downloaded directly. This PR adds usage of proxy for media too.

This PR adds some code duplication: both http_pool and routes/media modules now have setHttpProxy method and proxy var. Maybe I should refactor this a bit and make single global var and setter somewhere, but I'm not sure where to put it.

Also, maybe there should be separate proxy settings for API and media in config?

This is my first code edits in nim language.

digletthat avatar Oct 19 '25 18:10 digletthat

Does this allow to toggle on or off in the preferences?

unixfox avatar Nov 17 '25 13:11 unixfox

Does this allow to toggle on or off in the preferences?

No. I don't think it should be configurable by user. It's related to http proxy that is used for outgoing http requests, so it's part of nitter server configuration.

digletthat avatar Nov 17 '25 19:11 digletthat

Now that I think again about this PR, I didn't fully understand it well.

It's not about activating or deactivating the media proxy in nitter. But the http proxy when used in nitter. Sorry.

unixfox avatar Nov 17 '25 20:11 unixfox

I'm not sure I agree with this change. The purpose of the proxy is circumvent IP bans, and avoid IP-based detection. API requests are low bandwidth, media certainly isn't, and most proxies are either slow, expensive, or both. If you add a separate mediaProxy or something, then it makes sense, but having a proxy configured should not mean all media requests flow through it without a way to turn that off.

zedeus avatar Nov 18 '25 08:11 zedeus