[GH-ISSUE #3342] CORS error #2676

Closed
opened 2026-05-05 13:43:32 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @cancundeyingzi on GitHub (Mar 5, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3342

Bug Description

http网页中使用https资源,浏览器会报错
Access to XMLHttpRequest at 'xxx' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
上述http网页和https资源均使用frp穿透,
192.168局域网没有此问题,Cloudflare Tunnels的http/https网页也没此问题
也就是说,在调用frp穿透的https资源时,只有frp穿透的http网页报错

frpc Version

0.47

frps Version

0.46

System Architecture

win11

Configurations

[main]
type = http
local_ip = 1
local_port = 5244
custom_domains = c
use_encryption=true
use_compression=true

[w]
type = https
local_ip = 1
local_port = 443
custom_domains = c
use_encryption=true
use_compression=true
proxy_protocol_version = v2

Logs

No response

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @cancundeyingzi on GitHub (Mar 5, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3342 ### Bug Description http网页中使用https资源,浏览器会报错 `Access to XMLHttpRequest at 'xxx' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.` 上述http网页和https资源均使用frp穿透, 192.168局域网没有此问题,Cloudflare Tunnels的http/https网页也没此问题 也就是说,在调用frp穿透的https资源时,只有frp穿透的http网页报错 ### frpc Version 0.47 ### frps Version 0.46 ### System Architecture win11 ### Configurations [main] type = http local_ip = 1 local_port = 5244 custom_domains = c use_encryption=true use_compression=true [w] type = https local_ip = 1 local_port = 443 custom_domains = c use_encryption=true use_compression=true proxy_protocol_version = v2 ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [X] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:43:32 -06:00
Author
Owner

@Becods commented on GitHub (Mar 7, 2023):

非frp的问题

自行在网页服务器添加Access-Control-Allow-Origin

<!-- gh-comment-id:1458021628 --> @Becods commented on GitHub (Mar 7, 2023): 非frp的问题 自行在网页服务器添加`Access-Control-Allow-Origin`头
Author
Owner

@github-actions[bot] commented on GitHub (Apr 7, 2023):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1499791935 --> @github-actions[bot] commented on GitHub (Apr 7, 2023): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#2676
No description provided.