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

63 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 开发代理配置(仅 dev 生效)
* - 统一网关转发:仅代理 /api- 前缀到网关(/api-user、/api-uaa 等)
* - 生产环境由网关/容器转发,此文件不生效
*/
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: {
// API 请求代理(HTTP)
// 注意:WebSocket 在 deviceControlWs.ts 中直接连接网关,不经过此代理
'/api-': {
target: GATEWAY,
changeOrigin: true,
},
// 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: {
'/api-': {
target: GATEWAY,
changeOrigin: true,
ws: true,
},
'/goflymodel': {
target: 'https://minicdn.goflytec.com',
changeOrigin: true,
secure: false,
},
},
pre: {
'/api-': {
target: GATEWAY,
changeOrigin: true,
ws: true,
},
'/goflymodel': {
target: 'https://minicdn.goflytec.com',
changeOrigin: true,
secure: false,
},
},
} as const;