ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

[Feature] Proxy support

Open distrair opened this issue 1 year ago • 17 comments

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 avatar Mar 06 '23 08:03 distrair

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

lencx avatar Mar 06 '23 08:03 lencx

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

distrair avatar Mar 08 '23 13:03 distrair

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

JustTestCode avatar Mar 08 '23 22:03 JustTestCode

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

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

distrair avatar Mar 09 '23 07:03 distrair

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

distrair avatar Mar 09 '23 07:03 distrair

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()

JustTestCode avatar Mar 22 '23 09:03 JustTestCode

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.

yoohooyoo avatar Apr 06 '23 05:04 yoohooyoo

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

xsa-dev avatar Apr 15 '23 07:04 xsa-dev

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

edsky avatar Apr 24 '23 06:04 edsky

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?

xsa-dev avatar Apr 24 '23 18:04 xsa-dev

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 https://github.com/tauri-apps/tauri/commit/3dc38b150ea8c59c8ba67fd586f921016928f47c 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

edsky avatar Apr 25 '23 02:04 edsky

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.

xsa-dev avatar May 04 '23 18:05 xsa-dev

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

dickeylth avatar Jun 01 '23 16:06 dickeylth

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.

xsa-dev avatar Jun 17 '23 10:06 xsa-dev

Is this issue been solved or not?

scruel avatar Jul 10 '23 02:07 scruel

Is this issue been solved or not? No

xsa-dev avatar Jul 14 '23 12:07 xsa-dev

this feature still unsupported, uninstalled!

snowman avatar Jan 27 '24 14:01 snowman