Added proxy url setting in user options

This commit is contained in:
SuperSuslik312
2024-04-09 17:48:46 +03:00
parent e35c3a373d
commit c85bb70a7a
3 changed files with 5 additions and 2 deletions
@@ -10,6 +10,7 @@ let configOptions = {
'enhancements': true,
'useHistory': true,
'writingCursor': " ...", // Warning: Using weird characters can mess up Markdown rendering
'proxyUrl': '', // Can be "socks5://127.0.0.1:9050" or "http://127.0.0.1:8080" for example. Leave it blank if you don't need it.
},
'animations': {
'choreographyDelay': 35,
+2 -1
View File
@@ -299,7 +299,8 @@ class GeminiService extends Service {
// "apiKey": this._key,
};
const session = new Soup.Session();
const proxyResolver = new Gio.SimpleProxyResolver({ 'default-proxy': userOptions.ai.proxyUrl });
const session = new Soup.Session({ 'proxy-resolver': proxyResolver });
const message = new Soup.Message({
method: 'POST',
uri: GLib.Uri.parse(replaceapidom(`https://generativelanguage.googleapis.com/v1/models/${this.modelName}:streamGenerateContent?key=${this._key}`), GLib.UriFlags.NONE),
+2 -1
View File
@@ -246,7 +246,8 @@ class GPTService extends Service {
stream: true,
};
const session = new Soup.Session();
const proxyResolver = new Gio.SimpleProxyResolver({ 'default-proxy': userOptions.ai.proxyUrl });
const session = new Soup.Session({ 'proxy-resolver': proxyResolver });
const message = new Soup.Message({
method: 'POST',
uri: this._url,