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 Request] Using tauri http api in App #5379

Open
lloydzhou opened this issue Sep 7, 2024 · 7 comments
Open

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

lloydzhou opened this issue Sep 7, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@lloydzhou
Copy link
Collaborator

lloydzhou commented Sep 7, 2024

🥰 需求描述

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的服务(后续会下线服务,请使用旧版的用户升级之后更新自定义模型的地址)
@lloydzhou lloydzhou added the enhancement New feature or request label Sep 7, 2024
@lloydzhou
Copy link
Collaborator Author

@lloydzhou
Copy link
Collaborator Author

#5106
#4980
#4219
#3735
#4368

@Issues-translate-bot

This comment was marked as duplicate.

@lloydzhou
Copy link
Collaborator Author

尝试使用tauri http api,发现不支持stream模式

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Trying to use tauri http api, found that stream mode is not supported

@lloydzhou
Copy link
Collaborator Author

done #5565

@Issues-translate-bot

This comment was marked as duplicate.

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

3 participants