🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

rantd-react

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rantd-react

都走/api/proxy 不再为每个服务单独创建代理 代价太高 并发起来的时候 性能贼差

latest
npmnpm
Version
1.0.40-beta.3
Version published
Weekly downloads
45
-31.82%
Maintainers
2
Weekly downloads
 
Created
Source

TODO

项目里面的代理整理

都走/api/proxy 不再为每个服务单独创建代理 代价太高 并发起来的时候 性能贼差

useProxyMiddleware(app, '/api/proxy', {
  target: this.settingManager.GetApiAddress(),
  logLevel: proxyLogLevel,
  pathRewrite: {
    '^/api/proxy': '/',
  },
});
  • bff 代理的地方增加上述代理

    删除 InitAllServicesProxy

  • 在 client 中执行 替换

    api/(.*)Service ---> /api/proxy/$1 /api/(.*)Service ---> /api/proxy/$1

    这样就处理大多数的代理了 这里得注意下/api/GraphService 会被替换成 /api/proxy/Graph 会 404 在查找 /api/proxy/Graph 反替换为 api/GraphService

  • 然后 server 中搜索 @HttpProxy 一个一个的处理掉 这个得一个一个查找替换

  • 在处理 server/src/StartUp.ts 中其他的代理 类似/api/PhysicalModal/ImportPhysicalEquipModal 这种的代理 直接删除 替换为/proxy 形式

  • 最后处理 GraphService 相关的代理 暂时这么处理下 GraphService 等完全升级到 v2 版本后可以删除此配置 client 中搜索 RZGraphApiAddress 改为 /api/GraphService

删除 /api/GraphService/alarm /api/GraphService/oss /api/GraphService/basic 在图谱代码中搜索 alarm/ /oss basic/ 前面加上/proxy

  • ws 的代理也新建一个专门用于 ws 的 其他全删除

以后主力的代理就 2 个 一个 http 一个 ws 不再允许自己添加

改的时候开个分支改 测试完没问题在合并到主分支
影响范围比较大 测试的时候注意下 尤其那一个的小代理 改完点一下 看看有没有 404

FAQs

Package last updated on 29 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts