Skip to content

[Feature Request] Using tauri http api in App #5379

Closed
@lloydzhou

Description

@lloydzhou

🥰 需求描述

solve CORS error in App

🧐 解决方案

tauri

  1. 用tauri写了一个command,支持 发送request
  2. 这个command接收请求,并使用reqwest转发。
  3. 拿到http code以及header的时候,组成response返回给这个command作为返回值。
  4. 同时异步接收body,再使用事件发送给window

js

  1. 使用TrandformStream生成两个stream
  2. 其中writeableStream给监听事件的函数拿到body chunk之后往里面写
  3. readableStream给发送command的函数,拿到http code以及header之后一起生成Response对象。
  4. 这个fetch函数,返回的是js原生的Response对象,接收的参数也是一致的

📝 补充信息

  1. 这个版本已经移除了api.nextchat.dev的服务(后续会下线服务,请使用旧版的用户升级之后更新自定义模型的地址)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions