Skip to content

Commit

Permalink
chore(plugin-proxy): deprecated warnings (#5571)
Browse files Browse the repository at this point in the history
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
  • Loading branch information
SoonIter and chenjiahan committed Mar 23, 2024
1 parent 78b889f commit 8b4ea42
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/green-beds-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-js/main-doc': patch
'@modern-js/plugin-proxy': patch
---

add deprecated warning for @modern-js/plugin-proxy
4 changes: 4 additions & 0 deletions packages/cli/plugin-proxy/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { CliPlugin } from '@modern-js/core';
import { logger } from '@modern-js/utils';
import { createProxyRule } from './utils/createProxyRule';
import WhistleProxy from './utils/whistleProxy';

Expand All @@ -20,6 +21,9 @@ export const proxyPlugin = (): CliPlugin => {
const rule = createProxyRule(internalDirectory, dev.proxy);
if (!proxyServer) {
proxyServer = new WhistleProxy({ port: 8899, rule });
logger.warn(
'[Deprecated] @modern-js/plugin-proxy is no longer maintained. Please consider migrating to other proxy tools, such as whistle.',
);
await proxyServer.start();
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:::warning
`@modern-js/plugin-proxy` is no longer maintained and new versions will no longer be released. Please consider migrating to other proxy tools, such as [whistle](https://github.com/avwo/whistle).
:::

Modern.js provides an out-of-the-box global proxy plugin `@modern-js/plugin-proxy`, which is based on [whistle](https://github.com/avwo/whistle) and can be used to view and modify the requests and responses of HTTP/HTTPS, as well as be used as an HTTP proxy server.

### Setting Proxy Rules
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:::warning
`@modern-js/plugin-proxy` 已不再维护,后续将不再发布新版本。请迁移到其他代理工具,比如 [whistle](https://github.com/avwo/whistle)
:::

Modern.js 提供了开箱即用的全局代理插件 `@modern-js/plugin-proxy`,该插件底层基于 [whistle](https://github.com/avwo/whistle),可用来查看、修改 HTTP/HTTPS 的请求和响应,也可作为 HTTP 代理服务器使用。

### 设置代理规则
Expand Down

0 comments on commit 8b4ea42

Please sign in to comment.