Files
gofly-platform-services/zlt-web/react-web-next/config/proxy.ts
T

63 lines
1.5 KiB
TypeScript
Raw Normal View History

/**
* 开发代理配置(仅 dev 生效)
* - 统一网关转发:仅代理 /api- 前缀到网关(/api-user、/api-uaa 等)
* - 生产环境由网关/容器转发,此文件不生效
*/
2025-12-16 11:43:37 +08:00
const GATEWAY = process.env.GATEWAY_ORIGIN || 'http://192.168.2.214:9900';
// SRS流媒体服务器地址
const SRS_SERVER = process.env.SRS_SERVER || 'http://220.205.16.27:8024';
export default {
dev: {
2025-12-17 11:45:15 +08:00
// API 请求代理(HTTP)
// 注意:WebSocket 在 deviceControlWs.ts 中直接连接网关,不经过此代理
'/api-': {
target: GATEWAY,
changeOrigin: true,
},
2025-12-16 11:43:37 +08:00
// 3D模型CDN代理 - 解决跨域问题
'/goflymodel': {
target: 'https://minicdn.goflytec.com',
changeOrigin: true,
secure: false,
},
// SRS WebRTC WHEP 视频流代理
'/rtc': {
target: SRS_SERVER,
changeOrigin: true,
secure: false,
},
// SRS 登录认证接口代理
'/terraform': {
target: SRS_SERVER,
changeOrigin: true,
secure: false,
},
},
test: {
2025-12-17 11:45:15 +08:00
'/api-': {
target: GATEWAY,
changeOrigin: true,
ws: true,
},
2025-12-16 11:43:37 +08:00
'/goflymodel': {
target: 'https://minicdn.goflytec.com',
changeOrigin: true,
secure: false,
},
},
pre: {
2025-12-17 11:45:15 +08:00
'/api-': {
target: GATEWAY,
changeOrigin: true,
ws: true,
},
2025-12-16 11:43:37 +08:00
'/goflymodel': {
target: 'https://minicdn.goflytec.com',
changeOrigin: true,
secure: false,
},
},
} as const;