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] Proxy support #574

Open
distrair opened this issue Mar 6, 2023 · 17 comments
Open

[Feature] Proxy support #574

distrair opened this issue Mar 6, 2023 · 17 comments
Labels
enhancement New feature or request

Comments

@distrair
Copy link

distrair commented Mar 6, 2023

Feature description

Add a support to set a proxy server

Motivation

If you try to enter a website from other country, it shows that I don't have access to the website
image

Alternatives

Use a VPN

Additional context

No response

@distrair distrair added the enhancement New feature or request label Mar 6, 2023
@lencx
Copy link
Owner

lencx commented Mar 6, 2023

This project is built on tauri, which does not support proxy, so this functionality is not possible.

@distrair
Copy link
Author

distrair commented Mar 8, 2023

will nofwl get proxy support or its also made on tauri?

@JustTestCode
Copy link

JustTestCode commented Mar 8, 2023

The WindowBuilder (https://docs.rs/tauri/latest/tauri/window/struct.WindowBuilder.html) has/will have a additional_browser_args() method

(https://docs.rs/wry/latest/x86_64-pc-windows-msvc/wry/webview/trait.WebViewBuilderExtWindows.html#tymethod.with_additional_browser_args)

may be , you can use it.
i don't know rust , so I don't know how to use it

if can use, add --proxy-server=127.0.0.1:7890 the webview2 can use proxy

@distrair
Copy link
Author

distrair commented Mar 9, 2023

如果通过api密钥登录,其实可以解决这个问题,当遇到访问1小时限制,访问解决,IP限制的情况时。可以通过自己api密钥去直接访问ChatGPT。

不幸的是,我的帐户没有任何积分,我不能用我的卡来支付它,所以它应该是一个网络应用程序

@distrair
Copy link
Author

distrair commented Mar 9, 2023

The WindowBuilder (https://docs.rs/tauri/latest/tauri/window/struct.WindowBuilder.html) has/will have a additional_browser_args() method

(https://docs.rs/wry/latest/x86_64-pc-windows-msvc/wry/webview/trait.WebViewBuilderExtWindows.html#tymethod.with_additional_browser_args)

may be , you can use it.

i don't know rust , so I don't know how to use it

if can use, add --proxy-server=127.0.0.1:7890 the webview2 can use proxy

When I'm gonna get home, I'll try this

@JustTestCode
Copy link

change file at
C:\Users\xxx\.cargo\registry\src\github.com-1ecc6299db9ec823\wry-0.24.1\src\webview\webview2\mod.rs
130 line
"--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection --proxy-server=127.0.0.1:7890".to_string()

build, you can use proxy

ChatGPT.zip

change default port 7890

with open("ChatGPT.exe", "rb+") as f:
    data = f.read()
    data = data.replace(b"127.0.0.1:7890", b"127.0.0.1:1080")
    f.seek(0)
    f.write(data)
    f.truncate()

@yoohooyoo
Copy link

change file at C:\Users\xxx\.cargo\registry\src\github.com-1ecc6299db9ec823\wry-0.24.1\src\webview\webview2\mod.rs 130 line "--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection --proxy-server=127.0.0.1:7890".to_string()

build, you can use proxy

ChatGPT.zip

change default port 7890

with open("ChatGPT.exe", "rb+") as f:
    data = f.read()
    data = data.replace(b"127.0.0.1:7890", b"127.0.0.1:1080")
    f.seek(0)
    f.write(data)
    f.truncate()

It is recommended to submit a PR. This method works.

@xsa-dev
Copy link

xsa-dev commented Apr 15, 2023

The WindowBuilder (https://docs.rs/tauri/latest/tauri/window/struct.WindowBuilder.html) has/will have a additional_browser_args() method

(https://docs.rs/wry/latest/x86_64-pc-windows-msvc/wry/webview/trait.WebViewBuilderExtWindows.html#tymethod.with_additional_browser_args)

may be , you can use it.

i don't know rust , so I don't know how to use it

if can use, add --proxy-server=127.0.0.1:7890 the webview2 can use proxy

When I'm gonna get home, I'll try this

Does this works?

--proxy-server=127.0.0.1:7890

@Emvdy Emvdy mentioned this issue Apr 17, 2023
@edsky
Copy link

edsky commented Apr 24, 2023

The latest version of Tauri supports setting proxies, and if dependencies can be updated, users can choose to configure proxies themselves.

@xsa-dev
Copy link

xsa-dev commented Apr 24, 2023

The latest version of Tauri supports setting proxies, and if dependencies can be updated, users can choose to configure proxies themselves.

I couldn't find any information about it. I updated the packages, what's next?

@edsky
Copy link

edsky commented Apr 25, 2023

The latest version of Tauri supports setting proxies, and if dependencies can be updated, users can choose to configure proxies themselves.

I couldn't find any information about it. I updated the packages, what's next?

You can refer to this commit tauri-apps/tauri@3dc38b1
First of all, the version of Tauri should be 2.0 instead of 1.0. If you have upgraded, you can then set the startup command line and configure a proxy.

https://github.com/lencx/ChatGPT/blob/main/src-tauri/src/app/setup.rs#L70

@xsa-dev
Copy link

xsa-dev commented May 4, 2023

I created a topic in the Discord chat about this feature, but I couldn't solve it myself.
I'm waiting for Mac OS support here.

@dickeylth
Copy link

The latest version of Tauri supports setting proxies, and if dependencies can be updated, users can choose to configure proxies themselves.

I couldn't find any information about it. I updated the packages, what's next?

You can refer to this commit tauri-apps/tauri@3dc38b1 First of all, the version of Tauri should be 2.0 instead of 1.0. If you have upgraded, you can then set the startup command line and configure a proxy.

https://github.com/lencx/ChatGPT/blob/main/src-tauri/src/app/setup.rs#L70

Seems that latest v1.3.0 has merged the commit: https://github.com/tauri-apps/tauri/releases/tag/tauri-v1.3.0

@xsa-dev
Copy link

xsa-dev commented Jun 17, 2023

You can refer to this commit tauri-apps/tauri@3dc38b1 First of all, the version of Tauri should be 2.0 instead of 1.0. If you have upgraded, you can then set the startup command line and configure a proxy.

Waiting for MacOS.

@scruel
Copy link

scruel commented Jul 10, 2023

Is this issue been solved or not?

@xsa-dev
Copy link

xsa-dev commented Jul 14, 2023

Is this issue been solved or not?
No

@snowman
Copy link

snowman commented Jan 27, 2024

this feature still unsupported, uninstalled!

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

9 participants