nheko icon indicating copy to clipboard operation
nheko copied to clipboard

Explicit (SOCKS) proxy support through commandline flag or preferably settings

Open Mikaela opened this issue 3 years ago • 5 comments

The Problem

As per https://github.com/Nheko-Reborn/nheko/pull/626, proxy support should be configurable by environment variable http_proxy. However flatpak run --env=http_proxy=http://127.0.0.1:8118/ io.github.NhekoReborn.Nheko//master (with torrc HTTPTunnelPort 8118 IsolateDestAddr PreferIPv6 IsolateSOCKSAuth) still doesn't go through Tor.

The Solution

My preferred solution would be in two parts:

  • [ ] ability to configure socks proxy through Nheko settings so average users will be able to use it.
  • [ ] a command line flag that overrides :arrow_up: like Element-desktop has --proxy-server=socks5://127.0.0.1:9050 so it can be scripted or specified in launcher etc.

In my opinion also when connection to the proxy fails, Nheko shouldn't connect to the server without proxy if one is configured and instead show a warning.

Alternatives

No response

Additional context

My testing method included running flatpak run --env=http_proxy=http://127.0.0.1:8118/ io.github.NhekoReborn.Nheko//master and then opening Element Web and performing a clear cache and reload and Element Web restart which still resulted into Element Web claiming the two sessions were connecting from the same IP address.

Happens in the latest version

  • [X] Yes, this feature is still missing.

Mikaela avatar Apr 12 '22 12:04 Mikaela

It turns out the comment in #626 is wrong and the corrent environment variable to set is either https_proxy (I didn't try) or all_proxy which also accepts socks5 and works:

flatpak run --env=all_proxy=socks5://127.0.0.1:9050/ io.github.NhekoReborn.Nheko//master

However that makes matrix.org accounts not connect and terminal be flooded with html Cloudflare captchas, but I imagine that is a server-side problem.

Mikaela avatar Apr 12 '22 12:04 Mikaela

Cloudflare doesn't like tor, iirc.

deepbluev7 avatar Apr 12 '22 14:04 deepbluev7

Just commenting as I'm a prolific tor user and not being able to use tor with nheko is preventing me and others from using it.

Please note that other clients do not trigger the Cloudflare problems.

Normally this would be a server side issue as Mikaela points out and in fact I had such a problem that was resolved by opening the protections against Tor. However, with Nheko and Nheko alone I still get the disconnects. So I suspect that Nheko is spamming the connection somehow.

The problem occurs across multiple homeservers, engaging across various federated rooms.

Sazu-bit avatar Dec 30 '22 18:12 Sazu-bit

I've been using env HTTP_PROXY=socks://127.0.0.1:9050 HTTPS_PROXY=socks://127.0.0.1:9050 /usr/bin/flatpak run … with nhekoreborn for quite a while now with great success (i have a firewall AND if i omit these env nheko never connects of course) But I use nice homeservers so they don't ask for captchas. Also i was able to connect through the SAML login of one of my providers with success

gagzzz avatar Oct 19 '23 19:10 gagzzz