SimpleChatTC:Tools: Pick proxy server address from document[gMe]

This commit is contained in:
hanishkvc 2025-10-18 18:40:09 +05:30
parent 9b55775e8a
commit 04644761e6
2 changed files with 5 additions and 2 deletions

View File

@ -1035,6 +1035,7 @@ class Me {
//"frequency_penalty": 1.2,
//"presence_penalty": 1.2,
};
this.proxyUrl = "http://127.0.0.1:3128"
}
/**

View File

@ -115,7 +115,8 @@ let fetchweburlraw_meta = {
*/
function fetchweburlraw_run(toolcallid, toolname, obj) {
if (gToolsWorker.onmessage != null) {
let newUrl = `http://127.0.0.1:3128/urlraw?url=${encodeURIComponent(obj.url)}`
// @ts-ignore
let newUrl = `${document['gMe'].proxyUrl}/urlraw?url=${encodeURIComponent(obj.url)}`
fetch(newUrl).then(resp => {
if (!resp.ok) {
throw new Error(`${resp.status}:${resp.statusText}`);
@ -165,7 +166,8 @@ let fetchweburltext_meta = {
*/
function fetchweburltext_run(toolcallid, toolname, obj) {
if (gToolsWorker.onmessage != null) {
let newUrl = `http://127.0.0.1:3128/urltext?url=${encodeURIComponent(obj.url)}`
// @ts-ignore
let newUrl = `${document['gMe'].proxyUrl}/urltext?url=${encodeURIComponent(obj.url)}`
fetch(newUrl).then(resp => {
if (!resp.ok) {
throw new Error(`${resp.status}:${resp.statusText}`);