Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add UI for setting HTTP proxy to desktop app #772

Open
uhoreg opened this issue Feb 26, 2017 · 49 comments
Open

add UI for setting HTTP proxy to desktop app #772

uhoreg opened this issue Feb 26, 2017 · 49 comments

Comments

@uhoreg
Copy link
Member

uhoreg commented Feb 26, 2017

No description provided.

@uhoreg
Copy link
Member Author

uhoreg commented Apr 25, 2017

Apparently, you can set the proxy by using a --proxy-server option on the command-line (e.g. --proxy-server=socks5://127.0.0.1:9050)

@t3chguy
Copy link
Member

t3chguy commented Apr 25, 2017

@uhoreg yeah but you asked for a UI :P
that command line arg applies to chromium and electron

@uhoreg
Copy link
Member Author

uhoreg commented Apr 25, 2017

@t3chguy yup, just documenting here since people who are asking about proxying will probably find this issue. This way, they can use the command-line switch until a UI is done. ;)

@devdan
Copy link

devdan commented Jul 28, 2017

I tested this for a SOCKS5 proxy (Tor) and it does not work. It seems that electron does not support --proxy-server as a command line parameter.

Riot is simply ignoring the parameter and connects the normal way. This is pretty bad because you assume that everything works over the proxy.

@t3chguy
Copy link
Member

t3chguy commented Jul 28, 2017

@devdan what OS? If its through Squirrel (Windows and possibly Mac) the argument may get consumed before it makes it to electron

@devdan
Copy link

devdan commented Jul 28, 2017

Tested on Windows with the installer provided by riot.im. I don't know if it uses Squirrel or not.

@t3chguy
Copy link
Member

t3chguy commented Jul 28, 2017

@devdan yep that uses Squirrel.Windows as the updating mechanism, depending on which executable you are passing the argument to it may be consumed.

Try passing it to the executable %LOCALAPPDATA%\Riot\app-0.11.4\Riot.exe

@devdan
Copy link

devdan commented Jul 28, 2017

This works. Thanks a lot!

Still, it would be very nice to have UI settings for this.

@t3chguy
Copy link
Member

t3chguy commented Jul 28, 2017

@devdan definitely going to happen eventually, I'm looking at making giving the app a more userful top bar to replace the standard system window chroming which could have proxy settings as an option, currently hard to shove proxy settings somewhere as you cannot reach user settings pre-login or when on the login spinner

@eX00r
Copy link

eX00r commented Oct 19, 2017

Proxy settings in UI would be nice yes!

@CR0CKER
Copy link

CR0CKER commented Mar 13, 2018

Any updates on this? For those of us in less fortunate political environments, Tor support will quickly become pretty crucial.

@tmladek
Copy link

tmladek commented Mar 14, 2018

+1

@t3chguy
Copy link
Member

t3chguy commented Jul 10, 2018

note to self, auth proxies in electron are meh: electron/electron#3250

@natrius
Copy link

natrius commented Oct 22, 2018

For quick&dirty you can also make a riot.cmd wherever you want and add there the following line
START "" "%LOCALAPPDATA%\riot\Riot.exe" --proxy-server=socks5://127.0.0.1:9050
Just save and start with the cmd.

@RealShine
Copy link

Can't connect and send messages in China. Need network proxy function, urgent!

@t3chguy
Copy link
Member

t3chguy commented Dec 31, 2018

As documented in comments before, proxy function is already possible just has no ui

@ctsde-markus
Copy link

We just tried the workaround from 22 Oct 2018 on a Windows 10 PC but it doesn't work. Does it only work with a socks5 proxy? We have a squid proxy at http://IP:3128/ but no matter how we use the parameter--proxy-server=, it just gets ignored and the PC tries to connect directly to the matrix server without proxy (but is blocked by the router).

We tried (with and without surrounding "" for the proxy parameter):

START "" "%LOCALAPPDATA%\riot\Riot.exe" --proxy-server="http://IP:3128"
START "" "%LOCALAPPDATA%\riot\Riot.exe" --proxy-server="socks5://IP:3128"
START "" "%LOCALAPPDATA%\riot\Riot.exe" --proxy-server="IP:3128"

@t3chguy
Copy link
Member

t3chguy commented Jan 17, 2019

We just tried the workaround from 22 Oct 2018 on a Windows 10 PC but it doesn't work. Does it only work with a socks5 proxy? We have a squid proxy at http://IP:3128/ but no matter how we use the parameter--proxy-server=, it just gets ignored and the PC tries to connect directly to the matrix server without proxy (but is blocked by the router).

We tried (with and without surrounding "" for the proxy parameter):

START "" "%LOCALAPPDATA%\riot\Riot.exe" --proxy-server="http://IP:3128"
START "" "%LOCALAPPDATA%\riot\Riot.exe" --proxy-server="socks5://IP:3128"
START "" "%LOCALAPPDATA%\riot\Riot.exe" --proxy-server="IP:3128"

Re-read https://github.com/vector-im/riot-web/issues/3320#issuecomment-318668688 .

@Mikaela

This comment was marked as outdated.

@t3chguy
Copy link
Member

t3chguy commented Apr 15, 2019

The proxy engine in electron/chromium supports socks proxies so it's not at all incorrect. And any ui for proxy will work with both

@ghost
Copy link

ghost commented Jul 22, 2019

request some priority be given this 2+ year old issue. To run with command switch is a "work-around" that not many will learn of unless they search issues here, attempt to sort the command needed then verify it is working as expected.

Any updates on this? For those of us in less fortunate political environments, Tor support will quickly become pretty crucial.

Can't connect and send messages in China. Need network proxy function, urgent!

the above two comments speak of the true need for a solid proxy support (HTTP, and Socks4a and Socks5) and adding the settings to UI is the way to do it correctly for the masses.

@besendorf
Copy link

besendorf commented Dec 4, 2019

Just in case anyone else is confused by the example riot-desktop --proxy-server=socks5://127.0.0.1:9050
If you use Tor Browser the socks port is 9150 and not 9050.
I tried it with the command line paramter and it seems to work (riot doesnt connect if tor isnt running)
I didnt check if the IP leaks when doing something special though.

@ghost
Copy link

ghost commented Jan 2, 2020

+1 needed

@blurHY
Copy link

blurHY commented Mar 9, 2020

any progress on this ?

@t3chguy
Copy link
Member

t3chguy commented May 9, 2020

but I think it's critical as it focuses on privacy.

It is not critical as it is possible already to do over the command line, it just doesn't have a shiny UI. No privacy issues here, just user-friendliness ones.

@evilsh3ll
Copy link

evilsh3ll commented May 9, 2020

I'm on debian9 using the Nightly version and I'm not sure if riot is using tor, if I put a not valid proxy it seems to connect to internet, how can I be sure?

@besendorf
Copy link

besendorf commented May 9, 2020

I'm on debian9 using the Nightly version and I'm not sure if riot is using tor, if I put a not valid proxy it seems to connect to internet, how can I be sure?

riot-desktop --proxy-server=socks5://127.0.0.1:9150
without Tor Browser running and Riot didnt connect to the home server. If you want to be sure, especially with WebRTC, you'll have to check with wireshark.

@BoBeR182
Copy link

Any updates getting this done?

@githuberyt
Copy link

+1

@KBenster
Copy link

Yes, the electron proxy argument isn't honored by the client

@pilikan33
Copy link

i need tor too !

@h4x3rotab
Copy link

Copy & paste from the duplicated issue as some supplement information:

What would you like to do?

Change the proxy manually instead of using the system default proxy.

Why would you like to do it?

Accessing the global internet in some countries (e.g. China) could be complex. Sometimes we may want to proxy some software, while not touching the system proxy settings. A good example is Telegram, which allows the user to specify a list of the socks5 proxy, and can switch between them on the fly.

How would you like to achieve it?

Give user three options in the setting page:

  1. No proxy
  2. System default
  3. Manual (ask user to input protocol, host, port, and optionally username and password. Http and socks5 protocols are preferred)

@xanoni
Copy link

xanoni commented Sep 26, 2021

Just FYI guys, --proxy-server=127.0.0.1:9050 didn't work for me, but --proxy-server=127.0.0.1:8118 does. The latter is the default TOR HTTP proxy (not SOCKS proxy).

However, as already noted elsewhere, the auto-update mechanism will still bypass the proxy. To be really safe you have to use a more secure operating system (Whonix / Tails / Qubes) or at least use an iptables-based solution instead of the command line switch. I wouldn't trust a --proxy-server switch if my freedom depended on it.

@k0gen
Copy link

k0gen commented Apr 11, 2022

On macOS do:
open /Applications/Element.app --args --proxy-server=socks5://127.0.0.1:9050

Element should at least respect system default network settings (witch is not in macOS case)
Turns out this is not true. If you have your system wide proxy settings enabled to use Tor, Element.app will respect and use those settings. Tested on Element.app version 1.10.8.

@arenekosreal
Copy link

arenekosreal commented Apr 25, 2022

--proxy-server=address:port works for me. But address:port must be a HTTP proxy without authentication.
See https://www.electronjs.org/docs/latest/api/command-line-switches#--proxy-serveraddressport for more info
But I still want to have a UI for setting proxy, not only http proxy, but also socks.

@xanoni
Copy link

xanoni commented May 1, 2022

--proxy-server=address:port works for me. But address:port must be a HTTP proxy without authentication

It has limitations, though, see my post above.

@ChungZH

This comment was marked as spam.

@t3chguy t3chguy transferred this issue from element-hq/element-web Apr 18, 2023
@mat-l
Copy link

mat-l commented Aug 4, 2023

How is the progress about the implementation to pass the proxy via the ui instead of terminal command?

@HumanPopcycle

This comment was marked as off-topic.

@t3chguy
Copy link
Member

t3chguy commented Aug 14, 2023

@HumanPopcycle this repo is called element-desktop for a reason... It has nothing to do with the Android app.

@HumanPopcycle

This comment was marked as off-topic.

@t3chguy
Copy link
Member

t3chguy commented Aug 14, 2023

@HumanPopcycle https://github.com/vector-im/element-android is a native Kotlin project.

@tidux
Copy link

tidux commented Dec 13, 2023

Bumping this as lack of native SOCKS5 support is a reason for people to stick to Telegram over Element.

@t3chguy
Copy link
Member

t3chguy commented Dec 13, 2023

@tidux contributions welcome.

@andrewoficial
Copy link

Any news?

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

No branches or pull requests