tauri-apps / tauri-apps/plugins-workspace

[bug] error sending request for url

Open
#3,239 2 comments 0 reactions 0 assignees View on GitHub
plugin: http type: bug
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

### Describe the bug

Operating system: Windows 11

When using the `plugin-http` plugin to request a local API server via `localhost`, I consistently receive the error: `error sending request for url (http://localhost:5263/weatherforecast)`. However, requesting a public website like `https://tauri.app/zh-cn/plugin/http-client` works fine. I don't know what the reason is.

I tried sending a request from TypeScript to the Rust backend using a command, and then using `reqwest` to make the `localhost` request and return the result to the frontend TypeScript. This worked without any issues. I'm not sure if the `plugin-http` plugin has some special handling for `localhost` requests?

An example demo is attached.

[tauri-demo.zip](https://github.com/user-attachments/files/24979516/tauri-demo.zip)

### Reproduction

_No response_

### Expected behavior

_No response_

### Full `tauri info` output

```text
[✔] Environment
- OS: Windows 10.0.26200 x86_64 (X64)
✔ WebView2: 144.0.3719.93
✔ MSVC: Visual Studio Enterprise 2026
✔ rustc: 1.93.0 (254b59607 2026-01-19)
✔ cargo: 1.93.0 (083ac5135 2025-12-15)
✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
- node: 24.13.0
- pnpm: 10.28.2
- yarn: 1.22.22
- npm: 11.6.2

[-] Packages
- tauri 🦀: 2.9.5
- tauri-build 🦀: 2.5.3
- wry 🦀: 0.53.5, (outdated, latest: 0.54.1)
- tao 🦀: 0.34.5
- @tauri-apps/api ⱼₛ: 2.9.1
- @tauri-apps/cli ⱼₛ: 2.9.6

[-] Plugins
- tauri-plugin-fs 🦀: 2.4.5
- @tauri-apps/plugin-fs ⱼₛ: not installed!
- tauri-plugin-http 🦀: 2.5.6
- @tauri-apps/plugin-http ⱼₛ: 2.5.6
- tauri-plugin-opener 🦀: 2.5.3
- @tauri-apps/plugin-opener ⱼₛ: 2.5.3

[-] App
- build-type: bundle
- CSP: default-src 'self'; connect-src 'self' http://127.0.0.1:5263;
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- framework: React
- bundler: Vite
```

### Stack trace

```text

```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.