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

[Feature request] Add proxy setting #115

Open
Nokia808 opened this issue Jan 12, 2021 · 9 comments
Open

[Feature request] Add proxy setting #115

Nokia808 opened this issue Jan 12, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@Nokia808
Copy link

Nokia808 commented Jan 12, 2021

Hi.

This may be strange request from title ! But it's usefulness is that:

  1. unfortunately, there are certain situation in which even such sites like online translations are blocked ! In such cases this feature will be extremely useful ...
  2. to improve privacy of users, like utilizing Google via Tor network to avoid Google anti-privacy hanger....

If this feature accepted to be added as future enhancement, then it should allow SOCKS 5 proxy & should allow user to select UDP or TCP or automatic(UDP/TCP) protocol.

Thank you.

@mufeedali mufeedali added the enhancement New feature or request label Jan 12, 2021
@mufeedali
Copy link
Member

Personally, I don't think this is within the scope of the application and any proxy settings should probably be system-wide. What do you think, @rafaelmardojai ?

@Nokia808
Copy link
Author

Nokia808 commented Jan 13, 2021

@fushinari
Well, at a time it is more suitable to use system-wide solution. But at other cases it is more suitable to make only certain applications bypass the blockage .......

However, the final decision is up to the developer(s).

@mufeedali
Copy link
Member

Actually, I think I agree with you that it's a good addition. But it adds a layer of complexity that I'm not sure I want. Also, to implement it properly, we would need py-googletrans to also support proxy settings, but sadly, it's still marked as a TODO.

@Nokia808
Copy link
Author

@fushinari
It is very okay to be in "TODO" list ! Take your time.

@Venturub
Copy link

Venturub commented Feb 2, 2021

I agree with this. And would also add, as a suggestion, the user IP to be somehow replaced by another IP who would then be the one presenting directly the translation request to Google Translator. This would further justify the Dialect usage over the Google Translator website through the browser. I do not know the feasibility of this but it would be great... thanks!

@zefr0x
Copy link

zefr0x commented Nov 8, 2022

No need for that, we are in Linux :)

For Tor:

You can just use the torsocks tool to wrap dialect to use tor. (It is safer)

For other proxies:

You can use environment variables, for example:

export http_proxy=socks5://127.0.0.1:9050
export https_proxy=$http_proxy

Or to directly start dialect with them:

http_proxy=socks5://127.0.0.1:9050 https_proxy=$http_proxy dialect

The python-requests library supports it, thats why it will work for dialect.

Read this for more info: https://wiki.archlinux.org/title/Proxy_server#Environment_variables

You might be able to also use a sandboxing tool to apply a proxy, but I didn't test it.

@rafaelmardojai
Copy link
Member

The python-requests library supports it, thats why it will work for dialect.

Just for the record, Dialect doesn't use python-requests but libsoup. And it should respect the proxy settings from GNOME Settings.

@zefr0x
Copy link

zefr0x commented Nov 8, 2022

Oh

So python-requests is used for Google translate only?
gTTS uses it as I saw here. And I saw it here in the flatpak mainfest file.

After some search it should work with libsoup also for other translate services: https://mail.gnome.org/archives/libsoup-list/2009-February/msg00018.html

@rafaelmardojai
Copy link
Member

So python-requests is used for Google translate only?
gTTS uses it as I saw here. And I saw it here in the flatpak mainfest file.

Only Google text-to-speech (gTTS), Google translation is implemented with libsoup.

After some search it should work with libsoup also for other translate services: https://mail.gnome.org/archives/libsoup-list/2009-February/msg00018.html

Yeah, the env vars you pointed should work with libsoup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants