Skip to content

Conversation

@digletthat
Copy link

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.

@unixfox
Copy link
Contributor

unixfox commented Nov 17, 2025

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

@digletthat
Copy link
Author

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.

@unixfox
Copy link
Contributor

unixfox commented Nov 17, 2025

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.

@zedeus
Copy link
Owner

zedeus commented Nov 18, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants