diff --git a/.gitignore b/.gitignore
index de417b4ec3b..9bd70be4370 100755
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,8 @@
# Generated files
.docusaurus
.cache-loader
+yarn.lock
+package-lock.json
# Misc
.DS_Store
@@ -25,4 +27,3 @@ yarn-error.log*
*.ipr
*.iml
*.iws
-yarn.lock
\ No newline at end of file
diff --git a/docs/plugin-center/proxy/websocket-plugin.md b/docs/plugin-center/proxy/websocket-plugin.md
index b07f851e221..292571a3e84 100644
--- a/docs/plugin-center/proxy/websocket-plugin.md
+++ b/docs/plugin-center/proxy/websocket-plugin.md
@@ -1,38 +1,277 @@
---
-title: WebSocket Plugin
-keywords: ["WebSocket"]
-description: websocket plugin
+title: Websocket Plugin
+keywords: ["Websocket"]
+description: Websocket Plugin
---
+# 1. Overview
-The Apache ShenYu gateway implements support for the WebSocket proxy.
+## 1.1 Plugin Name
+* Websocket Plugin.
-## Environment to prepare
+## 1.2 Appropriate Scenario
-Please refer to the deployment to select a way to start shenyu-admin. For example, start the Apache ShenYu gateway management system through [local deployment](../../deployment/deployment-local) .
+* Forwarding scenarios, processing websocket protocol requests and forwarding them to other websocket protocol services on the backend.
+* Service Load Balancing.
-After successful startup, you need to open the Websocket plugin on in the BasicConfig `->` Plugin. For `Websocket` plugin details.
+## 1.3 Plugin functionality
-You can see it in PluginList -> rpc proxy -> Websocket. For details about the selector and rule configuration, see [Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule) .
+* Support traffic management based on host, uri, query and other request information.
+* Supports setting load balancing policies for requests and also supports service warm-up, currently supports three policies: ip hash (consistent hashing with virtual nodes), round-robbin (weighted polling), random (weighted random).
+* Support setting interface level request timeout time.
+* Support setting the number of timeout retries.
-Add the following dependencies to the gateway's `pom.xml` file:
+## 1.4 Plugin code
-```xml
-
-
- org.apache.shenyu
- shenyu-spring-boot-starter-plugin-websocket
- ${project.version}
-
+* Core Module ```shenyu-plugin-websocket```.
+* Core Class ```org.apache.shenyu.plugin.websocket.WebSocketPlugin```.
-```
+## 1.5 Added Since Which shenyu version
+
+- 2.4.1
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+![image-20220726223545558](/img/shenyu/plugin/websocket/procedure_chart_en.png)
+
+**Explanation of terms**
+- Shenyu gateway service:Include shenyu-admin and shenyu-bootstrap services.
+- Client services:Real backend websocket service.
+
+**Explanation of the process**
+1. Start shenyu gateway service: Refer to the deployment, start shenyu-admin and shenyu-bootstrap to make sure shenyu gateway service is normal.
+2. Enable the websocket plugin in shenyu-admin: Turn on the websocket plugin in the shenyu-admin plugin management page.
+3. Configure and start the client service: start the client project (real websocket service on the back end) and configure the service information into the shenyu gateway, in two ways: manual configuration and automatic configuration.
+4. Check if forwarding is normal: Check if forwarding is successful.
+
+## 2.2 Enable plugin
+
+- In shenyu-admin --> BasicConfig --> Plugin --> websocket is set to on.
+
+![image-20220726224444058](/img/shenyu/plugin/websocket/enable_websocket_en.png)
+
+
+## 2.3 Client Services configuration
+
+### 2.3.1 Manual configuration
+
+> Manually configure the client service on the shenyu-admin page, and the backend service will implement the websocket protocol forwarding without any changes.
+
+1. Adding selectors to the websocket plugin.
-## Request Path
+![image-20220726225217950](/img/shenyu/plugin/websocket/add_selector_en.png)
-When using Apache ShenYu proxy websocket, assume that the request path is:
+2. Add rules to the websocket plugin.
+![image-20220726225315550](/img/shenyu/plugin/websocket/add_rule_en.png)
+
+3. Start the client service (backend websocket service).
+
+4. Test the success of service forwarding.
+
+- See Annex 5.1 for the test code.
+
+![image-20220726222003131](/img/shenyu/plugin/websocket/test_result_en.png)
+
+### 2.3.2 Automatic configuration
+
+> If there are scenarios where you need to automate configuration to reduce workload, you can add annotations to the backend service to automate the configuration of the service to the shenyu gateway.
+
+1. Add the plugin maven configuration to the pom.xml file in the backend service project.
+
+```xml
+
+ org.apache.shenyu
+ shenyu-spring-boot-starter-plugin-websocket
+ ${project.version}
+
```
-ws://localhost:9195/wesocket
+
+2. Use the `@ShenyuSpringWebSocketClient` annotation, which will automatically register the websocket service to the shenyu gateway.
+3. Adjust the plugin configuration, see 2.4.1 for details of the configuration parameters.
+4. Start the client project (the backend `websocket service), see 2.5 for sample code.
+5. Check whether the PluginList service registration information in the shenyu-admin page is registered successfully.
+6. Test the success of service forwarding.
+
+- See Annex 5.1 for the test code.
+
+![image-20220726221945414](/img/shenyu/plugin/websocket/test_result_en.png)
+
+## 2.4 Config plugin
+
+### 2.4.1 Configure access parameters in the configuration file in the client service
+
+* Client access method and server address, the parameters are: `shenyu.register.*`, the following example uses the http access method, currently the client supports the following access methods: http, zookeeper, etcd, nacos, consul, please refer to [client access configuration](.../.../user-guide/register-center-access) for detailed access configuration parameters.
+* Client configuration with the parameter: `shenyu.client.websocket.*`, containing the service name, routing address and port, and the contextPath value must be configured as the routing address for each service.
+
+```yaml
+shenyu:
+ register:
+ registerType: http
+ serverLists: http://localhost:9095
+ props:
+ username: admin
+ password: 123456
+ client:
+ websocket:
+ props:
+ contextPath: /ws-annotation
+ appName: ws-annotation
+ port: 8001 # Need to be consistent with the service port
```
+### 2.4.2 Configure the websocket plugin's selector and rule information in shenyu-admin
+
+Using auto-configuration, after the client starts it will automatically register [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) in shenyu-admin -> Plugin List -> Proxy -> Websocket information.
+![image-20220725222628106](/img/shenyu/plugin/websocket/auto_register_en.png)
+
+#### 2.4.2.1 Configuration of selectors
+
+The example of websocket selector configuration, please refer to [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) for general selector configuration.
+
+![image-20220725222913298](/img/shenyu/plugin/websocket/config_selectors_en.png)
+
+##### 2.4.2.1.1 Selector handler configuration
+
+- `host`:Fill in `localhost`, this field is not used for now.
+- `ip:port`:`ip` and port, here fill in the `ip` + port of your real service.
+- `protocol`:`ws` protocol, do not fill in the default: `ws://`.
+- `startupTime`:Start-up time in milliseconds.
+- `weight`:The default value for load balancing weight, which is automatically registered for service startup, is 50.
+- `warmupTime`:Warm-up time, in milliseconds, the server in warm-up will calculate the instantaneous weight, the calculated value will be less than the actual weight configured to protect the server just started, the default value of service start registration is 10. For example, the warm-up time is 100 milliseconds, currently started 50 milliseconds, the configured weight is 50, the actual weight is 25.
+- `status`:open or close, the start state of this processor is only valid.
+
+#### 2.4.2.2 Configuration of rules
+
+The example of websocket rule configuration, please refer to [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) for general rule configuration .
+
+![image-20220725223225388](/img/shenyu/plugin/websocket/config_rules_en.png)
+
+##### 2.4.2.2.1 Rule handler configuration
+
+- `loadStrategy`: if the websocket client is a cluster, which load balancing strategy to take when the Apache ShenYu gateway is invoked, currently supports roundRobin, random and hash.
+- `timeout`: The timeout period for calling the client.
+- `retryCount`: The number of retries to call client timeout failures.
+
+## 2.5 示例
+
+### 2.5.1 Spring Annotation Websocket Example
+
+[shenyu-example-spring-annotation-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-annotation-websocket)
+
+### 2.5.2 Spring Native Websocket Example
+
+[shenyu-example-spring-native-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket)
+
+### 2.5.3 Spring Reactive Websocket Example
+
+[shenyu-example-spring-reactive-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket)
+
+# 3. How to disable plugin
+
+- shenyu-admin --> BasicConfig --> Plugin --> Close websocket plugin status.
+
+![image-20220726231206572](/img/shenyu/plugin/websocket/close_websocket_en.png)
+
+# 4. Frequently Asked Questions
+
+**4.1 Websocket connection establishment error 1002**
+
+Possible causes: client service is not normal, shenyu gateway and client project can not establish a normal connection, please check the gateway to the client network, client service is normal.
+
+**4.2 Multiple client services are displayed as empty in the websocket selector**
+
+Possible cause: BasicConfig -> Plugin -> websocket -> multiSelectorHandle option select multiple handle.
+
+![image-20220726222250136](/img/shenyu/plugin/websocket/questions_multiSelectorHandle_en.png)
+
+# 5. Annexes
+
+## 5.1 websocket debugging code
+
+- Create a file called websocket.html and copy the following code into the file.
+- Open websocket.html with Chrome.
+
+```html
+
+
+
+
+ Shenyu WebSocket Test
+
+
+
+
+
+
+
+
+
+
+
+
+```
diff --git a/docusaurus.config.js b/docusaurus.config.js
index 987cb39c0c4..2c777aebe28 100755
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -70,7 +70,7 @@ module.exports = {
to: "/docs/2.4.1/index",
},
{
- label: "2.4.1",
+ label: "2.4.0",
to: "/docs/2.4.0/index",
},
{
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/proxy/websocket-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/proxy/websocket-plugin.md
index e9bf2912db1..b3d9e6b6013 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/proxy/websocket-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/proxy/websocket-plugin.md
@@ -1,37 +1,277 @@
---
-title: WebSocket代理
-keywords: ["WebSocket"]
-description: websocket代理
+title: Websocket插件
+keywords: ["Websocket"]
+description: Websocket插件
---
-`Apache ShenYu` 网关通过`Websocket`插件实现了对`websocket`代理的支持。
+# 1. 概述
+## 1.1 插件名称
-## 环境准备
+* Websocket 插件
-请参考运维部署的内容,选择一种方式启动`shenyu-admin`。比如,通过 [本地部署](../deployment-local) 启动`Apache ShenYu`后台管理系统。
+## 1.2 适用场景
-启动成功后,需要在基础配置`->`插件管理中,把`websocket` 插件设置为开启。
+* 转发场景,处理 websocket协议 请求,将其转发到后端其他 websocket 协议的服务
+* 服务负载均衡
-选择器和规则配置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
+## 1.3 插件功能
-在网关的 `pom.xml` 文件中引入`websocket`插件的相关依赖:
+* 支持根据 host、uri、query 等请求信息做流量的治理
+* 支持设置请求的负载均衡策略,同时支持服务预热,目前支持三种策略:ip hash(带虚拟节点的一致性哈希)、round-robbin(加权轮询)、random(加权随机)
+* 支持设置接口级别请求超时时间
+* 支持设置超时重试次数
-```xml
-
-
- org.apache.shenyu
- shenyu-spring-boot-starter-plugin-websocket
- ${project.version}
-
+## 1.4 插件代码
-```
+* 核心模块 ```shenyu-plugin-websocket```
+* 核心类 ```org.apache.shenyu.plugin.websocket.WebSocketPlugin```
+
+## 1.5 添加自哪个shenyu版本
+
+- 2.4.1
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+![image-20220725162054383](/img/shenyu/plugin/websocket/procedure_chart_zh.png)
+
+**名词解释**
+- shenyu 网关:包含 shenyu-admin 和 shenyu-bootstrap 服务。
+- 客户端项目:后端真实 websocket 服务
+
+**流程解释**
+1. 启动 shenyu 网关服务:参照运维部署,启动 shenyu-admin 和 shenyu-bootstrap,确保 shenyu 网关服务正常
+2. 在 shenyu-admin 中启用 websocket 插件:在 shenyu-admin 插件管理的页面中开启 websocket 插件
+3. 配置和启动客户端项目:启动客户端项目(后端真实 websocket 服务),并将服务信息配置到 shenyu 网关中,分为手动配置和自动配置两种方式
+4. 检查转发是否正常:检查转发能否成功
+
+## 2.2 启用插件
+
+- 在 shenyu-admin --> 基础配置 --> 插件管理 --> websocket 设置为开启。
+
+![image-20220724223435359](/img/shenyu/plugin/websocket/enable_websocket_zh.png)
+
+
+## 2.3 配置客户端服务
+
+### 2.3.1 手动配置
+
+> 在 shenyu-admin 页面上手动配置客户端服务,后端服务不需要任何改动,即可实现 websocket 协议转发
+
+1. Websocket 插件中添加选择器
-## 请求路径
+![image-20220725142728044](/img/shenyu/plugin/websocket/add_selector_zh.png)
-使用 Apache ShenYu 代理websocket的时候,只需要使用ws协议开头,后面路径为真实Websocket路径:
+2. Websocket 插件中添加规则
+![image-20220725142951481](/img/shenyu/plugin/websocket/add_rule_zh.png)
+
+3. 启动客户端项目(后端 websocket 服务)
+
+4. 测试服务转发是否成功
+
+- 测试代码见附件5.1
+
+![image-20220726222003131](/img/shenyu/plugin/websocket/test_result_en.png)
+
+### 2.3.2 自动配置
+
+> 如果某些场景你需要通过自动配置来减少工作量,可以在后端服务中增加注解,实现自动配置服务到 shenyu 网关中
+
+1. 在后端服务项目中的 pom.xml 文件中添加插件 maven 配置。
+
+```xml
+
+ org.apache.shenyu
+ shenyu-spring-boot-starter-plugin-websocket
+ ${project.version}
+
```
-ws://localhost:9195/xxx
+
+2. 使用`@ShenyuSpringWebSocketClient`注解,该注解会将 websocket 服务自动注册到 shenyu 网关
+3. 调整插件配置,配置参数详情见 2.4.1
+4. 启动客户端项目(后端 websocket 服务),示例代码见 2.5 示例
+5. 检查 shenyu-admin 页面中插件列表服务注册信息是否注册成功
+6. 测试服务转发是否成功
+
+- 测试代码见附件5.1
+
+![image-20220726221945414](/img/shenyu/plugin/websocket/test_result_en.png)
+
+## 2.4 配置插件
+
+### 2.4.1 在客户端项目中配置文件中配置接入参数
+
+* 客户端接入方式和服务器地址,参数为: `shenyu.register.*`,下面的示例使用了 http 接入方式,目前客户端支持的接入的方式有以下几种:http、zookeeper、etcd、nacos、consul,详细的接入配置参数请参考[客户端接入配置](../../user-guide/register-center-access)。
+* 客户端配置,参数为: `shenyu.client.websocket.*`,包含服务的名称、路由地址以及端口,必须配置 contextPath 的值作为每个服务的路由地址。
+
+```yaml
+shenyu:
+ register:
+ registerType: http
+ serverLists: http://localhost:9095
+ props:
+ username: admin
+ password: 123456
+ client:
+ websocket:
+ props:
+ contextPath: /ws-annotation
+ appName: ws-annotation
+ port: 8001 # 需要和服务端口保持一致
```
+### 2.4.2 在 shenyu-admin 配置 websocket 插件的选择器和规则信息
+
+使用自动配置的方式,在客户端启动之后会在 shenyu-admin -> 插件列表 -> Proxy -> Websocket 自动注册[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)信息。
+![image-20220725222628106](/img/shenyu/plugin/websocket/auto_register_zh.png)
+
+#### 2.4.2.1 选择器的配置
+
+Websocket 选择器示例,通用选择器配置请参考[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)。
+
+![image-20220725222913298](/img/shenyu/plugin/websocket/config_selectors_zh.png)
+
+##### 2.4.2.1.1 选择器处理信息配置
+
+- `host`:填写 `localhost`,该字段暂时没使用。
+- `ip:port`:`ip` 与端口,这里填写你真实服务的 `ip` + 端口。
+- `protocol`::`ws` 协议,不填写默认为:`ws://`
+- `startupTime`: 启动时间,单位毫秒。
+- `weight`:负载均衡权重,服务启动自动注册的默认值为 50。
+- `warmupTime`:预热时间,单位毫秒,在预热中的服务器会计算瞬时权重,计算值会小于实际配置的权重,以保护刚启动的服务器,服务启动注册的默认值为 10。举个例子预热时间 100 毫秒,目前启动了 50 毫秒,配置的权重 50, 实际的权重是 25。
+- `status`:开启或关闭,开始状态此处理器才有效。
+
+#### 2.4.2.2 规则的配置
+
+Websocket 规则示例,通用规则配置请参考[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)。
+
+![image-20220725223225388](/img/shenyu/plugin/websocket/config_rules_zh.png)
+
+##### 2.4.2.2.1 规则处理信息配置
+
+- `loadStrategy`:如果 websocket 客户端是一个集群,Apache ShenYu 网关调用时采取哪种负载均衡策略,当前支持 roundRobin、random 和 hash。
+- `timeout`:调用客户端的超时时间。
+- `retryCount`:调用客户端超时失败的重试次数。
+
+## 2.5 示例
+
+### 2.5.1 Spring Annotation Websocket使用示例
+
+[shenyu-example-spring-annotation-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-annotation-websocket)
+
+### 2.5.2 Spring Native Websocket 使用示例
+
+[shenyu-example-spring-native-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket)
+
+### 2.5.3 Spring Reactive Websocket 使用示例
+
+[shenyu-example-spring-reactive-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket)
+
+# 3. 如何禁用插件
+
+- 在 shenyu-admin --> 基础配置 --> 插件管理 --> 关闭 websocket 插件状态
+
+![image-20220725141221131](/img/shenyu/plugin/websocket/close_websocket_zh.png)
+
+# 4. 常见问题
+
+**4.1 websocket 建立连接出现 1002 错误**
+
+可能原因:客户端服务不正常,shenyu 网关和客户端项目不能建立正常连接,请检查网关到客户端的网络、客户端服务是否正常
+
+**4.2 多个客户端服务在 websocket 选择器中展示为空**
+
+可能原因:基础配置-> 插件管理 -> websocket -> multiSelectorHandle 选项选择 multiple handle
+
+![image-20220726222250136](/img/shenyu/plugin/websocket/questions_multiSelectorHandle_zh.png)
+
+# 5. 附件
+
+## 5.1 websocket调试代码
+
+- 创建一个名为 websocket.html 的文件,复制下面的代码到文件中
+- 使用谷歌浏览器打开 websocket.html
+
+```html
+
+
+
+
+ Shenyu WebSocket Test
+
+
+
+
+
+
+
+
+
+
+
+
+```
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.1/plugin-center/proxy/websocket-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.1/plugin-center/proxy/websocket-plugin.md
index e9bf2912db1..b3d9e6b6013 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.1/plugin-center/proxy/websocket-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.1/plugin-center/proxy/websocket-plugin.md
@@ -1,37 +1,277 @@
---
-title: WebSocket代理
-keywords: ["WebSocket"]
-description: websocket代理
+title: Websocket插件
+keywords: ["Websocket"]
+description: Websocket插件
---
-`Apache ShenYu` 网关通过`Websocket`插件实现了对`websocket`代理的支持。
+# 1. 概述
+## 1.1 插件名称
-## 环境准备
+* Websocket 插件
-请参考运维部署的内容,选择一种方式启动`shenyu-admin`。比如,通过 [本地部署](../deployment-local) 启动`Apache ShenYu`后台管理系统。
+## 1.2 适用场景
-启动成功后,需要在基础配置`->`插件管理中,把`websocket` 插件设置为开启。
+* 转发场景,处理 websocket协议 请求,将其转发到后端其他 websocket 协议的服务
+* 服务负载均衡
-选择器和规则配置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
+## 1.3 插件功能
-在网关的 `pom.xml` 文件中引入`websocket`插件的相关依赖:
+* 支持根据 host、uri、query 等请求信息做流量的治理
+* 支持设置请求的负载均衡策略,同时支持服务预热,目前支持三种策略:ip hash(带虚拟节点的一致性哈希)、round-robbin(加权轮询)、random(加权随机)
+* 支持设置接口级别请求超时时间
+* 支持设置超时重试次数
-```xml
-
-
- org.apache.shenyu
- shenyu-spring-boot-starter-plugin-websocket
- ${project.version}
-
+## 1.4 插件代码
-```
+* 核心模块 ```shenyu-plugin-websocket```
+* 核心类 ```org.apache.shenyu.plugin.websocket.WebSocketPlugin```
+
+## 1.5 添加自哪个shenyu版本
+
+- 2.4.1
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+![image-20220725162054383](/img/shenyu/plugin/websocket/procedure_chart_zh.png)
+
+**名词解释**
+- shenyu 网关:包含 shenyu-admin 和 shenyu-bootstrap 服务。
+- 客户端项目:后端真实 websocket 服务
+
+**流程解释**
+1. 启动 shenyu 网关服务:参照运维部署,启动 shenyu-admin 和 shenyu-bootstrap,确保 shenyu 网关服务正常
+2. 在 shenyu-admin 中启用 websocket 插件:在 shenyu-admin 插件管理的页面中开启 websocket 插件
+3. 配置和启动客户端项目:启动客户端项目(后端真实 websocket 服务),并将服务信息配置到 shenyu 网关中,分为手动配置和自动配置两种方式
+4. 检查转发是否正常:检查转发能否成功
+
+## 2.2 启用插件
+
+- 在 shenyu-admin --> 基础配置 --> 插件管理 --> websocket 设置为开启。
+
+![image-20220724223435359](/img/shenyu/plugin/websocket/enable_websocket_zh.png)
+
+
+## 2.3 配置客户端服务
+
+### 2.3.1 手动配置
+
+> 在 shenyu-admin 页面上手动配置客户端服务,后端服务不需要任何改动,即可实现 websocket 协议转发
+
+1. Websocket 插件中添加选择器
-## 请求路径
+![image-20220725142728044](/img/shenyu/plugin/websocket/add_selector_zh.png)
-使用 Apache ShenYu 代理websocket的时候,只需要使用ws协议开头,后面路径为真实Websocket路径:
+2. Websocket 插件中添加规则
+![image-20220725142951481](/img/shenyu/plugin/websocket/add_rule_zh.png)
+
+3. 启动客户端项目(后端 websocket 服务)
+
+4. 测试服务转发是否成功
+
+- 测试代码见附件5.1
+
+![image-20220726222003131](/img/shenyu/plugin/websocket/test_result_en.png)
+
+### 2.3.2 自动配置
+
+> 如果某些场景你需要通过自动配置来减少工作量,可以在后端服务中增加注解,实现自动配置服务到 shenyu 网关中
+
+1. 在后端服务项目中的 pom.xml 文件中添加插件 maven 配置。
+
+```xml
+
+ org.apache.shenyu
+ shenyu-spring-boot-starter-plugin-websocket
+ ${project.version}
+
```
-ws://localhost:9195/xxx
+
+2. 使用`@ShenyuSpringWebSocketClient`注解,该注解会将 websocket 服务自动注册到 shenyu 网关
+3. 调整插件配置,配置参数详情见 2.4.1
+4. 启动客户端项目(后端 websocket 服务),示例代码见 2.5 示例
+5. 检查 shenyu-admin 页面中插件列表服务注册信息是否注册成功
+6. 测试服务转发是否成功
+
+- 测试代码见附件5.1
+
+![image-20220726221945414](/img/shenyu/plugin/websocket/test_result_en.png)
+
+## 2.4 配置插件
+
+### 2.4.1 在客户端项目中配置文件中配置接入参数
+
+* 客户端接入方式和服务器地址,参数为: `shenyu.register.*`,下面的示例使用了 http 接入方式,目前客户端支持的接入的方式有以下几种:http、zookeeper、etcd、nacos、consul,详细的接入配置参数请参考[客户端接入配置](../../user-guide/register-center-access)。
+* 客户端配置,参数为: `shenyu.client.websocket.*`,包含服务的名称、路由地址以及端口,必须配置 contextPath 的值作为每个服务的路由地址。
+
+```yaml
+shenyu:
+ register:
+ registerType: http
+ serverLists: http://localhost:9095
+ props:
+ username: admin
+ password: 123456
+ client:
+ websocket:
+ props:
+ contextPath: /ws-annotation
+ appName: ws-annotation
+ port: 8001 # 需要和服务端口保持一致
```
+### 2.4.2 在 shenyu-admin 配置 websocket 插件的选择器和规则信息
+
+使用自动配置的方式,在客户端启动之后会在 shenyu-admin -> 插件列表 -> Proxy -> Websocket 自动注册[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)信息。
+![image-20220725222628106](/img/shenyu/plugin/websocket/auto_register_zh.png)
+
+#### 2.4.2.1 选择器的配置
+
+Websocket 选择器示例,通用选择器配置请参考[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)。
+
+![image-20220725222913298](/img/shenyu/plugin/websocket/config_selectors_zh.png)
+
+##### 2.4.2.1.1 选择器处理信息配置
+
+- `host`:填写 `localhost`,该字段暂时没使用。
+- `ip:port`:`ip` 与端口,这里填写你真实服务的 `ip` + 端口。
+- `protocol`::`ws` 协议,不填写默认为:`ws://`
+- `startupTime`: 启动时间,单位毫秒。
+- `weight`:负载均衡权重,服务启动自动注册的默认值为 50。
+- `warmupTime`:预热时间,单位毫秒,在预热中的服务器会计算瞬时权重,计算值会小于实际配置的权重,以保护刚启动的服务器,服务启动注册的默认值为 10。举个例子预热时间 100 毫秒,目前启动了 50 毫秒,配置的权重 50, 实际的权重是 25。
+- `status`:开启或关闭,开始状态此处理器才有效。
+
+#### 2.4.2.2 规则的配置
+
+Websocket 规则示例,通用规则配置请参考[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)。
+
+![image-20220725223225388](/img/shenyu/plugin/websocket/config_rules_zh.png)
+
+##### 2.4.2.2.1 规则处理信息配置
+
+- `loadStrategy`:如果 websocket 客户端是一个集群,Apache ShenYu 网关调用时采取哪种负载均衡策略,当前支持 roundRobin、random 和 hash。
+- `timeout`:调用客户端的超时时间。
+- `retryCount`:调用客户端超时失败的重试次数。
+
+## 2.5 示例
+
+### 2.5.1 Spring Annotation Websocket使用示例
+
+[shenyu-example-spring-annotation-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-annotation-websocket)
+
+### 2.5.2 Spring Native Websocket 使用示例
+
+[shenyu-example-spring-native-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket)
+
+### 2.5.3 Spring Reactive Websocket 使用示例
+
+[shenyu-example-spring-reactive-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket)
+
+# 3. 如何禁用插件
+
+- 在 shenyu-admin --> 基础配置 --> 插件管理 --> 关闭 websocket 插件状态
+
+![image-20220725141221131](/img/shenyu/plugin/websocket/close_websocket_zh.png)
+
+# 4. 常见问题
+
+**4.1 websocket 建立连接出现 1002 错误**
+
+可能原因:客户端服务不正常,shenyu 网关和客户端项目不能建立正常连接,请检查网关到客户端的网络、客户端服务是否正常
+
+**4.2 多个客户端服务在 websocket 选择器中展示为空**
+
+可能原因:基础配置-> 插件管理 -> websocket -> multiSelectorHandle 选项选择 multiple handle
+
+![image-20220726222250136](/img/shenyu/plugin/websocket/questions_multiSelectorHandle_zh.png)
+
+# 5. 附件
+
+## 5.1 websocket调试代码
+
+- 创建一个名为 websocket.html 的文件,复制下面的代码到文件中
+- 使用谷歌浏览器打开 websocket.html
+
+```html
+
+
+
+
+ Shenyu WebSocket Test
+
+
+
+
+
+
+
+
+
+
+
+
+```
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.2/plugin-center/proxy/websocket-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.2/plugin-center/proxy/websocket-plugin.md
index e9bf2912db1..b3d9e6b6013 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.2/plugin-center/proxy/websocket-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.2/plugin-center/proxy/websocket-plugin.md
@@ -1,37 +1,277 @@
---
-title: WebSocket代理
-keywords: ["WebSocket"]
-description: websocket代理
+title: Websocket插件
+keywords: ["Websocket"]
+description: Websocket插件
---
-`Apache ShenYu` 网关通过`Websocket`插件实现了对`websocket`代理的支持。
+# 1. 概述
+## 1.1 插件名称
-## 环境准备
+* Websocket 插件
-请参考运维部署的内容,选择一种方式启动`shenyu-admin`。比如,通过 [本地部署](../deployment-local) 启动`Apache ShenYu`后台管理系统。
+## 1.2 适用场景
-启动成功后,需要在基础配置`->`插件管理中,把`websocket` 插件设置为开启。
+* 转发场景,处理 websocket协议 请求,将其转发到后端其他 websocket 协议的服务
+* 服务负载均衡
-选择器和规则配置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
+## 1.3 插件功能
-在网关的 `pom.xml` 文件中引入`websocket`插件的相关依赖:
+* 支持根据 host、uri、query 等请求信息做流量的治理
+* 支持设置请求的负载均衡策略,同时支持服务预热,目前支持三种策略:ip hash(带虚拟节点的一致性哈希)、round-robbin(加权轮询)、random(加权随机)
+* 支持设置接口级别请求超时时间
+* 支持设置超时重试次数
-```xml
-
-
- org.apache.shenyu
- shenyu-spring-boot-starter-plugin-websocket
- ${project.version}
-
+## 1.4 插件代码
-```
+* 核心模块 ```shenyu-plugin-websocket```
+* 核心类 ```org.apache.shenyu.plugin.websocket.WebSocketPlugin```
+
+## 1.5 添加自哪个shenyu版本
+
+- 2.4.1
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+![image-20220725162054383](/img/shenyu/plugin/websocket/procedure_chart_zh.png)
+
+**名词解释**
+- shenyu 网关:包含 shenyu-admin 和 shenyu-bootstrap 服务。
+- 客户端项目:后端真实 websocket 服务
+
+**流程解释**
+1. 启动 shenyu 网关服务:参照运维部署,启动 shenyu-admin 和 shenyu-bootstrap,确保 shenyu 网关服务正常
+2. 在 shenyu-admin 中启用 websocket 插件:在 shenyu-admin 插件管理的页面中开启 websocket 插件
+3. 配置和启动客户端项目:启动客户端项目(后端真实 websocket 服务),并将服务信息配置到 shenyu 网关中,分为手动配置和自动配置两种方式
+4. 检查转发是否正常:检查转发能否成功
+
+## 2.2 启用插件
+
+- 在 shenyu-admin --> 基础配置 --> 插件管理 --> websocket 设置为开启。
+
+![image-20220724223435359](/img/shenyu/plugin/websocket/enable_websocket_zh.png)
+
+
+## 2.3 配置客户端服务
+
+### 2.3.1 手动配置
+
+> 在 shenyu-admin 页面上手动配置客户端服务,后端服务不需要任何改动,即可实现 websocket 协议转发
+
+1. Websocket 插件中添加选择器
-## 请求路径
+![image-20220725142728044](/img/shenyu/plugin/websocket/add_selector_zh.png)
-使用 Apache ShenYu 代理websocket的时候,只需要使用ws协议开头,后面路径为真实Websocket路径:
+2. Websocket 插件中添加规则
+![image-20220725142951481](/img/shenyu/plugin/websocket/add_rule_zh.png)
+
+3. 启动客户端项目(后端 websocket 服务)
+
+4. 测试服务转发是否成功
+
+- 测试代码见附件5.1
+
+![image-20220726222003131](/img/shenyu/plugin/websocket/test_result_en.png)
+
+### 2.3.2 自动配置
+
+> 如果某些场景你需要通过自动配置来减少工作量,可以在后端服务中增加注解,实现自动配置服务到 shenyu 网关中
+
+1. 在后端服务项目中的 pom.xml 文件中添加插件 maven 配置。
+
+```xml
+
+ org.apache.shenyu
+ shenyu-spring-boot-starter-plugin-websocket
+ ${project.version}
+
```
-ws://localhost:9195/xxx
+
+2. 使用`@ShenyuSpringWebSocketClient`注解,该注解会将 websocket 服务自动注册到 shenyu 网关
+3. 调整插件配置,配置参数详情见 2.4.1
+4. 启动客户端项目(后端 websocket 服务),示例代码见 2.5 示例
+5. 检查 shenyu-admin 页面中插件列表服务注册信息是否注册成功
+6. 测试服务转发是否成功
+
+- 测试代码见附件5.1
+
+![image-20220726221945414](/img/shenyu/plugin/websocket/test_result_en.png)
+
+## 2.4 配置插件
+
+### 2.4.1 在客户端项目中配置文件中配置接入参数
+
+* 客户端接入方式和服务器地址,参数为: `shenyu.register.*`,下面的示例使用了 http 接入方式,目前客户端支持的接入的方式有以下几种:http、zookeeper、etcd、nacos、consul,详细的接入配置参数请参考[客户端接入配置](../../user-guide/register-center-access)。
+* 客户端配置,参数为: `shenyu.client.websocket.*`,包含服务的名称、路由地址以及端口,必须配置 contextPath 的值作为每个服务的路由地址。
+
+```yaml
+shenyu:
+ register:
+ registerType: http
+ serverLists: http://localhost:9095
+ props:
+ username: admin
+ password: 123456
+ client:
+ websocket:
+ props:
+ contextPath: /ws-annotation
+ appName: ws-annotation
+ port: 8001 # 需要和服务端口保持一致
```
+### 2.4.2 在 shenyu-admin 配置 websocket 插件的选择器和规则信息
+
+使用自动配置的方式,在客户端启动之后会在 shenyu-admin -> 插件列表 -> Proxy -> Websocket 自动注册[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)信息。
+![image-20220725222628106](/img/shenyu/plugin/websocket/auto_register_zh.png)
+
+#### 2.4.2.1 选择器的配置
+
+Websocket 选择器示例,通用选择器配置请参考[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)。
+
+![image-20220725222913298](/img/shenyu/plugin/websocket/config_selectors_zh.png)
+
+##### 2.4.2.1.1 选择器处理信息配置
+
+- `host`:填写 `localhost`,该字段暂时没使用。
+- `ip:port`:`ip` 与端口,这里填写你真实服务的 `ip` + 端口。
+- `protocol`::`ws` 协议,不填写默认为:`ws://`
+- `startupTime`: 启动时间,单位毫秒。
+- `weight`:负载均衡权重,服务启动自动注册的默认值为 50。
+- `warmupTime`:预热时间,单位毫秒,在预热中的服务器会计算瞬时权重,计算值会小于实际配置的权重,以保护刚启动的服务器,服务启动注册的默认值为 10。举个例子预热时间 100 毫秒,目前启动了 50 毫秒,配置的权重 50, 实际的权重是 25。
+- `status`:开启或关闭,开始状态此处理器才有效。
+
+#### 2.4.2.2 规则的配置
+
+Websocket 规则示例,通用规则配置请参考[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)。
+
+![image-20220725223225388](/img/shenyu/plugin/websocket/config_rules_zh.png)
+
+##### 2.4.2.2.1 规则处理信息配置
+
+- `loadStrategy`:如果 websocket 客户端是一个集群,Apache ShenYu 网关调用时采取哪种负载均衡策略,当前支持 roundRobin、random 和 hash。
+- `timeout`:调用客户端的超时时间。
+- `retryCount`:调用客户端超时失败的重试次数。
+
+## 2.5 示例
+
+### 2.5.1 Spring Annotation Websocket使用示例
+
+[shenyu-example-spring-annotation-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-annotation-websocket)
+
+### 2.5.2 Spring Native Websocket 使用示例
+
+[shenyu-example-spring-native-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket)
+
+### 2.5.3 Spring Reactive Websocket 使用示例
+
+[shenyu-example-spring-reactive-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket)
+
+# 3. 如何禁用插件
+
+- 在 shenyu-admin --> 基础配置 --> 插件管理 --> 关闭 websocket 插件状态
+
+![image-20220725141221131](/img/shenyu/plugin/websocket/close_websocket_zh.png)
+
+# 4. 常见问题
+
+**4.1 websocket 建立连接出现 1002 错误**
+
+可能原因:客户端服务不正常,shenyu 网关和客户端项目不能建立正常连接,请检查网关到客户端的网络、客户端服务是否正常
+
+**4.2 多个客户端服务在 websocket 选择器中展示为空**
+
+可能原因:基础配置-> 插件管理 -> websocket -> multiSelectorHandle 选项选择 multiple handle
+
+![image-20220726222250136](/img/shenyu/plugin/websocket/questions_multiSelectorHandle_zh.png)
+
+# 5. 附件
+
+## 5.1 websocket调试代码
+
+- 创建一个名为 websocket.html 的文件,复制下面的代码到文件中
+- 使用谷歌浏览器打开 websocket.html
+
+```html
+
+
+
+
+ Shenyu WebSocket Test
+
+
+
+
+
+
+
+
+
+
+
+
+```
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/proxy/websocket-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/proxy/websocket-plugin.md
index e9bf2912db1..b3d9e6b6013 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/proxy/websocket-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/proxy/websocket-plugin.md
@@ -1,37 +1,277 @@
---
-title: WebSocket代理
-keywords: ["WebSocket"]
-description: websocket代理
+title: Websocket插件
+keywords: ["Websocket"]
+description: Websocket插件
---
-`Apache ShenYu` 网关通过`Websocket`插件实现了对`websocket`代理的支持。
+# 1. 概述
+## 1.1 插件名称
-## 环境准备
+* Websocket 插件
-请参考运维部署的内容,选择一种方式启动`shenyu-admin`。比如,通过 [本地部署](../deployment-local) 启动`Apache ShenYu`后台管理系统。
+## 1.2 适用场景
-启动成功后,需要在基础配置`->`插件管理中,把`websocket` 插件设置为开启。
+* 转发场景,处理 websocket协议 请求,将其转发到后端其他 websocket 协议的服务
+* 服务负载均衡
-选择器和规则配置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
+## 1.3 插件功能
-在网关的 `pom.xml` 文件中引入`websocket`插件的相关依赖:
+* 支持根据 host、uri、query 等请求信息做流量的治理
+* 支持设置请求的负载均衡策略,同时支持服务预热,目前支持三种策略:ip hash(带虚拟节点的一致性哈希)、round-robbin(加权轮询)、random(加权随机)
+* 支持设置接口级别请求超时时间
+* 支持设置超时重试次数
-```xml
-
-
- org.apache.shenyu
- shenyu-spring-boot-starter-plugin-websocket
- ${project.version}
-
+## 1.4 插件代码
-```
+* 核心模块 ```shenyu-plugin-websocket```
+* 核心类 ```org.apache.shenyu.plugin.websocket.WebSocketPlugin```
+
+## 1.5 添加自哪个shenyu版本
+
+- 2.4.1
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+![image-20220725162054383](/img/shenyu/plugin/websocket/procedure_chart_zh.png)
+
+**名词解释**
+- shenyu 网关:包含 shenyu-admin 和 shenyu-bootstrap 服务。
+- 客户端项目:后端真实 websocket 服务
+
+**流程解释**
+1. 启动 shenyu 网关服务:参照运维部署,启动 shenyu-admin 和 shenyu-bootstrap,确保 shenyu 网关服务正常
+2. 在 shenyu-admin 中启用 websocket 插件:在 shenyu-admin 插件管理的页面中开启 websocket 插件
+3. 配置和启动客户端项目:启动客户端项目(后端真实 websocket 服务),并将服务信息配置到 shenyu 网关中,分为手动配置和自动配置两种方式
+4. 检查转发是否正常:检查转发能否成功
+
+## 2.2 启用插件
+
+- 在 shenyu-admin --> 基础配置 --> 插件管理 --> websocket 设置为开启。
+
+![image-20220724223435359](/img/shenyu/plugin/websocket/enable_websocket_zh.png)
+
+
+## 2.3 配置客户端服务
+
+### 2.3.1 手动配置
+
+> 在 shenyu-admin 页面上手动配置客户端服务,后端服务不需要任何改动,即可实现 websocket 协议转发
+
+1. Websocket 插件中添加选择器
-## 请求路径
+![image-20220725142728044](/img/shenyu/plugin/websocket/add_selector_zh.png)
-使用 Apache ShenYu 代理websocket的时候,只需要使用ws协议开头,后面路径为真实Websocket路径:
+2. Websocket 插件中添加规则
+![image-20220725142951481](/img/shenyu/plugin/websocket/add_rule_zh.png)
+
+3. 启动客户端项目(后端 websocket 服务)
+
+4. 测试服务转发是否成功
+
+- 测试代码见附件5.1
+
+![image-20220726222003131](/img/shenyu/plugin/websocket/test_result_en.png)
+
+### 2.3.2 自动配置
+
+> 如果某些场景你需要通过自动配置来减少工作量,可以在后端服务中增加注解,实现自动配置服务到 shenyu 网关中
+
+1. 在后端服务项目中的 pom.xml 文件中添加插件 maven 配置。
+
+```xml
+
+ org.apache.shenyu
+ shenyu-spring-boot-starter-plugin-websocket
+ ${project.version}
+
```
-ws://localhost:9195/xxx
+
+2. 使用`@ShenyuSpringWebSocketClient`注解,该注解会将 websocket 服务自动注册到 shenyu 网关
+3. 调整插件配置,配置参数详情见 2.4.1
+4. 启动客户端项目(后端 websocket 服务),示例代码见 2.5 示例
+5. 检查 shenyu-admin 页面中插件列表服务注册信息是否注册成功
+6. 测试服务转发是否成功
+
+- 测试代码见附件5.1
+
+![image-20220726221945414](/img/shenyu/plugin/websocket/test_result_en.png)
+
+## 2.4 配置插件
+
+### 2.4.1 在客户端项目中配置文件中配置接入参数
+
+* 客户端接入方式和服务器地址,参数为: `shenyu.register.*`,下面的示例使用了 http 接入方式,目前客户端支持的接入的方式有以下几种:http、zookeeper、etcd、nacos、consul,详细的接入配置参数请参考[客户端接入配置](../../user-guide/register-center-access)。
+* 客户端配置,参数为: `shenyu.client.websocket.*`,包含服务的名称、路由地址以及端口,必须配置 contextPath 的值作为每个服务的路由地址。
+
+```yaml
+shenyu:
+ register:
+ registerType: http
+ serverLists: http://localhost:9095
+ props:
+ username: admin
+ password: 123456
+ client:
+ websocket:
+ props:
+ contextPath: /ws-annotation
+ appName: ws-annotation
+ port: 8001 # 需要和服务端口保持一致
```
+### 2.4.2 在 shenyu-admin 配置 websocket 插件的选择器和规则信息
+
+使用自动配置的方式,在客户端启动之后会在 shenyu-admin -> 插件列表 -> Proxy -> Websocket 自动注册[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)信息。
+![image-20220725222628106](/img/shenyu/plugin/websocket/auto_register_zh.png)
+
+#### 2.4.2.1 选择器的配置
+
+Websocket 选择器示例,通用选择器配置请参考[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)。
+
+![image-20220725222913298](/img/shenyu/plugin/websocket/config_selectors_zh.png)
+
+##### 2.4.2.1.1 选择器处理信息配置
+
+- `host`:填写 `localhost`,该字段暂时没使用。
+- `ip:port`:`ip` 与端口,这里填写你真实服务的 `ip` + 端口。
+- `protocol`::`ws` 协议,不填写默认为:`ws://`
+- `startupTime`: 启动时间,单位毫秒。
+- `weight`:负载均衡权重,服务启动自动注册的默认值为 50。
+- `warmupTime`:预热时间,单位毫秒,在预热中的服务器会计算瞬时权重,计算值会小于实际配置的权重,以保护刚启动的服务器,服务启动注册的默认值为 10。举个例子预热时间 100 毫秒,目前启动了 50 毫秒,配置的权重 50, 实际的权重是 25。
+- `status`:开启或关闭,开始状态此处理器才有效。
+
+#### 2.4.2.2 规则的配置
+
+Websocket 规则示例,通用规则配置请参考[选择器和规则](../../user-guide/admin-usage/selector-and-rule.md)。
+
+![image-20220725223225388](/img/shenyu/plugin/websocket/config_rules_zh.png)
+
+##### 2.4.2.2.1 规则处理信息配置
+
+- `loadStrategy`:如果 websocket 客户端是一个集群,Apache ShenYu 网关调用时采取哪种负载均衡策略,当前支持 roundRobin、random 和 hash。
+- `timeout`:调用客户端的超时时间。
+- `retryCount`:调用客户端超时失败的重试次数。
+
+## 2.5 示例
+
+### 2.5.1 Spring Annotation Websocket使用示例
+
+[shenyu-example-spring-annotation-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-annotation-websocket)
+
+### 2.5.2 Spring Native Websocket 使用示例
+
+[shenyu-example-spring-native-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket)
+
+### 2.5.3 Spring Reactive Websocket 使用示例
+
+[shenyu-example-spring-reactive-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket)
+
+# 3. 如何禁用插件
+
+- 在 shenyu-admin --> 基础配置 --> 插件管理 --> 关闭 websocket 插件状态
+
+![image-20220725141221131](/img/shenyu/plugin/websocket/close_websocket_zh.png)
+
+# 4. 常见问题
+
+**4.1 websocket 建立连接出现 1002 错误**
+
+可能原因:客户端服务不正常,shenyu 网关和客户端项目不能建立正常连接,请检查网关到客户端的网络、客户端服务是否正常
+
+**4.2 多个客户端服务在 websocket 选择器中展示为空**
+
+可能原因:基础配置-> 插件管理 -> websocket -> multiSelectorHandle 选项选择 multiple handle
+
+![image-20220726222250136](/img/shenyu/plugin/websocket/questions_multiSelectorHandle_zh.png)
+
+# 5. 附件
+
+## 5.1 websocket调试代码
+
+- 创建一个名为 websocket.html 的文件,复制下面的代码到文件中
+- 使用谷歌浏览器打开 websocket.html
+
+```html
+
+
+
+
+ Shenyu WebSocket Test
+
+
+
+
+
+
+
+
+
+
+
+
+```
diff --git a/static/img/shenyu/plugin/websocket/add_rule_en.png b/static/img/shenyu/plugin/websocket/add_rule_en.png
new file mode 100644
index 00000000000..5ea9e5a1cf6
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/add_rule_en.png differ
diff --git a/static/img/shenyu/plugin/websocket/add_rule_zh.png b/static/img/shenyu/plugin/websocket/add_rule_zh.png
new file mode 100644
index 00000000000..33f71dd41dc
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/add_rule_zh.png differ
diff --git a/static/img/shenyu/plugin/websocket/add_selector_en.png b/static/img/shenyu/plugin/websocket/add_selector_en.png
new file mode 100644
index 00000000000..2b7ca7c23be
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/add_selector_en.png differ
diff --git a/static/img/shenyu/plugin/websocket/add_selector_zh.png b/static/img/shenyu/plugin/websocket/add_selector_zh.png
new file mode 100644
index 00000000000..ed28f40e7f7
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/add_selector_zh.png differ
diff --git a/static/img/shenyu/plugin/websocket/auto_register_en.png b/static/img/shenyu/plugin/websocket/auto_register_en.png
new file mode 100644
index 00000000000..87e28b25ba2
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/auto_register_en.png differ
diff --git a/static/img/shenyu/plugin/websocket/auto_register_zh.png b/static/img/shenyu/plugin/websocket/auto_register_zh.png
new file mode 100644
index 00000000000..88ddc5265ec
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/auto_register_zh.png differ
diff --git a/static/img/shenyu/plugin/websocket/close_websocket_en.png b/static/img/shenyu/plugin/websocket/close_websocket_en.png
new file mode 100644
index 00000000000..8a407763487
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/close_websocket_en.png differ
diff --git a/static/img/shenyu/plugin/websocket/close_websocket_zh.png b/static/img/shenyu/plugin/websocket/close_websocket_zh.png
new file mode 100644
index 00000000000..d852dd67872
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/close_websocket_zh.png differ
diff --git a/static/img/shenyu/plugin/websocket/config_rules_en.png b/static/img/shenyu/plugin/websocket/config_rules_en.png
new file mode 100644
index 00000000000..e1eb5d1454d
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/config_rules_en.png differ
diff --git a/static/img/shenyu/plugin/websocket/config_rules_zh.png b/static/img/shenyu/plugin/websocket/config_rules_zh.png
new file mode 100644
index 00000000000..8ba91347c52
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/config_rules_zh.png differ
diff --git a/static/img/shenyu/plugin/websocket/config_selectors_en.png b/static/img/shenyu/plugin/websocket/config_selectors_en.png
new file mode 100644
index 00000000000..9d1efacefe5
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/config_selectors_en.png differ
diff --git a/static/img/shenyu/plugin/websocket/config_selectors_zh.png b/static/img/shenyu/plugin/websocket/config_selectors_zh.png
new file mode 100644
index 00000000000..af286f4e65f
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/config_selectors_zh.png differ
diff --git a/static/img/shenyu/plugin/websocket/enable_websocket_en.png b/static/img/shenyu/plugin/websocket/enable_websocket_en.png
new file mode 100644
index 00000000000..1bfb9a9d58f
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/enable_websocket_en.png differ
diff --git a/static/img/shenyu/plugin/websocket/enable_websocket_zh.png b/static/img/shenyu/plugin/websocket/enable_websocket_zh.png
new file mode 100644
index 00000000000..de413ee916d
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/enable_websocket_zh.png differ
diff --git a/static/img/shenyu/plugin/websocket/procedure_chart_en.png b/static/img/shenyu/plugin/websocket/procedure_chart_en.png
new file mode 100644
index 00000000000..f2c1a5074ab
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/procedure_chart_en.png differ
diff --git a/static/img/shenyu/plugin/websocket/procedure_chart_zh.png b/static/img/shenyu/plugin/websocket/procedure_chart_zh.png
new file mode 100644
index 00000000000..2f782f1610d
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/procedure_chart_zh.png differ
diff --git a/static/img/shenyu/plugin/websocket/questions_multiSelectorHandle_en.png b/static/img/shenyu/plugin/websocket/questions_multiSelectorHandle_en.png
new file mode 100644
index 00000000000..881f2e3febe
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/questions_multiSelectorHandle_en.png differ
diff --git a/static/img/shenyu/plugin/websocket/questions_multiSelectorHandle_zh.png b/static/img/shenyu/plugin/websocket/questions_multiSelectorHandle_zh.png
new file mode 100644
index 00000000000..7e9ba5133e8
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/questions_multiSelectorHandle_zh.png differ
diff --git a/static/img/shenyu/plugin/websocket/test_result_en.png b/static/img/shenyu/plugin/websocket/test_result_en.png
new file mode 100644
index 00000000000..2129211b6fa
Binary files /dev/null and b/static/img/shenyu/plugin/websocket/test_result_en.png differ
diff --git a/versioned_docs/version-2.4.1/plugin-center/proxy/websocket-plugin.md b/versioned_docs/version-2.4.1/plugin-center/proxy/websocket-plugin.md
index b07f851e221..292571a3e84 100644
--- a/versioned_docs/version-2.4.1/plugin-center/proxy/websocket-plugin.md
+++ b/versioned_docs/version-2.4.1/plugin-center/proxy/websocket-plugin.md
@@ -1,38 +1,277 @@
---
-title: WebSocket Plugin
-keywords: ["WebSocket"]
-description: websocket plugin
+title: Websocket Plugin
+keywords: ["Websocket"]
+description: Websocket Plugin
---
+# 1. Overview
-The Apache ShenYu gateway implements support for the WebSocket proxy.
+## 1.1 Plugin Name
+* Websocket Plugin.
-## Environment to prepare
+## 1.2 Appropriate Scenario
-Please refer to the deployment to select a way to start shenyu-admin. For example, start the Apache ShenYu gateway management system through [local deployment](../../deployment/deployment-local) .
+* Forwarding scenarios, processing websocket protocol requests and forwarding them to other websocket protocol services on the backend.
+* Service Load Balancing.
-After successful startup, you need to open the Websocket plugin on in the BasicConfig `->` Plugin. For `Websocket` plugin details.
+## 1.3 Plugin functionality
-You can see it in PluginList -> rpc proxy -> Websocket. For details about the selector and rule configuration, see [Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule) .
+* Support traffic management based on host, uri, query and other request information.
+* Supports setting load balancing policies for requests and also supports service warm-up, currently supports three policies: ip hash (consistent hashing with virtual nodes), round-robbin (weighted polling), random (weighted random).
+* Support setting interface level request timeout time.
+* Support setting the number of timeout retries.
-Add the following dependencies to the gateway's `pom.xml` file:
+## 1.4 Plugin code
-```xml
-
-
- org.apache.shenyu
- shenyu-spring-boot-starter-plugin-websocket
- ${project.version}
-
+* Core Module ```shenyu-plugin-websocket```.
+* Core Class ```org.apache.shenyu.plugin.websocket.WebSocketPlugin```.
-```
+## 1.5 Added Since Which shenyu version
+
+- 2.4.1
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+![image-20220726223545558](/img/shenyu/plugin/websocket/procedure_chart_en.png)
+
+**Explanation of terms**
+- Shenyu gateway service:Include shenyu-admin and shenyu-bootstrap services.
+- Client services:Real backend websocket service.
+
+**Explanation of the process**
+1. Start shenyu gateway service: Refer to the deployment, start shenyu-admin and shenyu-bootstrap to make sure shenyu gateway service is normal.
+2. Enable the websocket plugin in shenyu-admin: Turn on the websocket plugin in the shenyu-admin plugin management page.
+3. Configure and start the client service: start the client project (real websocket service on the back end) and configure the service information into the shenyu gateway, in two ways: manual configuration and automatic configuration.
+4. Check if forwarding is normal: Check if forwarding is successful.
+
+## 2.2 Enable plugin
+
+- In shenyu-admin --> BasicConfig --> Plugin --> websocket is set to on.
+
+![image-20220726224444058](/img/shenyu/plugin/websocket/enable_websocket_en.png)
+
+
+## 2.3 Client Services configuration
+
+### 2.3.1 Manual configuration
+
+> Manually configure the client service on the shenyu-admin page, and the backend service will implement the websocket protocol forwarding without any changes.
+
+1. Adding selectors to the websocket plugin.
-## Request Path
+![image-20220726225217950](/img/shenyu/plugin/websocket/add_selector_en.png)
-When using Apache ShenYu proxy websocket, assume that the request path is:
+2. Add rules to the websocket plugin.
+![image-20220726225315550](/img/shenyu/plugin/websocket/add_rule_en.png)
+
+3. Start the client service (backend websocket service).
+
+4. Test the success of service forwarding.
+
+- See Annex 5.1 for the test code.
+
+![image-20220726222003131](/img/shenyu/plugin/websocket/test_result_en.png)
+
+### 2.3.2 Automatic configuration
+
+> If there are scenarios where you need to automate configuration to reduce workload, you can add annotations to the backend service to automate the configuration of the service to the shenyu gateway.
+
+1. Add the plugin maven configuration to the pom.xml file in the backend service project.
+
+```xml
+
+ org.apache.shenyu
+ shenyu-spring-boot-starter-plugin-websocket
+ ${project.version}
+
```
-ws://localhost:9195/wesocket
+
+2. Use the `@ShenyuSpringWebSocketClient` annotation, which will automatically register the websocket service to the shenyu gateway.
+3. Adjust the plugin configuration, see 2.4.1 for details of the configuration parameters.
+4. Start the client project (the backend `websocket service), see 2.5 for sample code.
+5. Check whether the PluginList service registration information in the shenyu-admin page is registered successfully.
+6. Test the success of service forwarding.
+
+- See Annex 5.1 for the test code.
+
+![image-20220726221945414](/img/shenyu/plugin/websocket/test_result_en.png)
+
+## 2.4 Config plugin
+
+### 2.4.1 Configure access parameters in the configuration file in the client service
+
+* Client access method and server address, the parameters are: `shenyu.register.*`, the following example uses the http access method, currently the client supports the following access methods: http, zookeeper, etcd, nacos, consul, please refer to [client access configuration](.../.../user-guide/register-center-access) for detailed access configuration parameters.
+* Client configuration with the parameter: `shenyu.client.websocket.*`, containing the service name, routing address and port, and the contextPath value must be configured as the routing address for each service.
+
+```yaml
+shenyu:
+ register:
+ registerType: http
+ serverLists: http://localhost:9095
+ props:
+ username: admin
+ password: 123456
+ client:
+ websocket:
+ props:
+ contextPath: /ws-annotation
+ appName: ws-annotation
+ port: 8001 # Need to be consistent with the service port
```
+### 2.4.2 Configure the websocket plugin's selector and rule information in shenyu-admin
+
+Using auto-configuration, after the client starts it will automatically register [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) in shenyu-admin -> Plugin List -> Proxy -> Websocket information.
+![image-20220725222628106](/img/shenyu/plugin/websocket/auto_register_en.png)
+
+#### 2.4.2.1 Configuration of selectors
+
+The example of websocket selector configuration, please refer to [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) for general selector configuration.
+
+![image-20220725222913298](/img/shenyu/plugin/websocket/config_selectors_en.png)
+
+##### 2.4.2.1.1 Selector handler configuration
+
+- `host`:Fill in `localhost`, this field is not used for now.
+- `ip:port`:`ip` and port, here fill in the `ip` + port of your real service.
+- `protocol`:`ws` protocol, do not fill in the default: `ws://`.
+- `startupTime`:Start-up time in milliseconds.
+- `weight`:The default value for load balancing weight, which is automatically registered for service startup, is 50.
+- `warmupTime`:Warm-up time, in milliseconds, the server in warm-up will calculate the instantaneous weight, the calculated value will be less than the actual weight configured to protect the server just started, the default value of service start registration is 10. For example, the warm-up time is 100 milliseconds, currently started 50 milliseconds, the configured weight is 50, the actual weight is 25.
+- `status`:open or close, the start state of this processor is only valid.
+
+#### 2.4.2.2 Configuration of rules
+
+The example of websocket rule configuration, please refer to [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) for general rule configuration .
+
+![image-20220725223225388](/img/shenyu/plugin/websocket/config_rules_en.png)
+
+##### 2.4.2.2.1 Rule handler configuration
+
+- `loadStrategy`: if the websocket client is a cluster, which load balancing strategy to take when the Apache ShenYu gateway is invoked, currently supports roundRobin, random and hash.
+- `timeout`: The timeout period for calling the client.
+- `retryCount`: The number of retries to call client timeout failures.
+
+## 2.5 示例
+
+### 2.5.1 Spring Annotation Websocket Example
+
+[shenyu-example-spring-annotation-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-annotation-websocket)
+
+### 2.5.2 Spring Native Websocket Example
+
+[shenyu-example-spring-native-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket)
+
+### 2.5.3 Spring Reactive Websocket Example
+
+[shenyu-example-spring-reactive-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket)
+
+# 3. How to disable plugin
+
+- shenyu-admin --> BasicConfig --> Plugin --> Close websocket plugin status.
+
+![image-20220726231206572](/img/shenyu/plugin/websocket/close_websocket_en.png)
+
+# 4. Frequently Asked Questions
+
+**4.1 Websocket connection establishment error 1002**
+
+Possible causes: client service is not normal, shenyu gateway and client project can not establish a normal connection, please check the gateway to the client network, client service is normal.
+
+**4.2 Multiple client services are displayed as empty in the websocket selector**
+
+Possible cause: BasicConfig -> Plugin -> websocket -> multiSelectorHandle option select multiple handle.
+
+![image-20220726222250136](/img/shenyu/plugin/websocket/questions_multiSelectorHandle_en.png)
+
+# 5. Annexes
+
+## 5.1 websocket debugging code
+
+- Create a file called websocket.html and copy the following code into the file.
+- Open websocket.html with Chrome.
+
+```html
+
+
+
+
+ Shenyu WebSocket Test
+
+
+
+
+
+
+
+
+
+
+
+
+```
diff --git a/versioned_docs/version-2.4.2/plugin-center/proxy/websocket-plugin.md b/versioned_docs/version-2.4.2/plugin-center/proxy/websocket-plugin.md
index b07f851e221..292571a3e84 100644
--- a/versioned_docs/version-2.4.2/plugin-center/proxy/websocket-plugin.md
+++ b/versioned_docs/version-2.4.2/plugin-center/proxy/websocket-plugin.md
@@ -1,38 +1,277 @@
---
-title: WebSocket Plugin
-keywords: ["WebSocket"]
-description: websocket plugin
+title: Websocket Plugin
+keywords: ["Websocket"]
+description: Websocket Plugin
---
+# 1. Overview
-The Apache ShenYu gateway implements support for the WebSocket proxy.
+## 1.1 Plugin Name
+* Websocket Plugin.
-## Environment to prepare
+## 1.2 Appropriate Scenario
-Please refer to the deployment to select a way to start shenyu-admin. For example, start the Apache ShenYu gateway management system through [local deployment](../../deployment/deployment-local) .
+* Forwarding scenarios, processing websocket protocol requests and forwarding them to other websocket protocol services on the backend.
+* Service Load Balancing.
-After successful startup, you need to open the Websocket plugin on in the BasicConfig `->` Plugin. For `Websocket` plugin details.
+## 1.3 Plugin functionality
-You can see it in PluginList -> rpc proxy -> Websocket. For details about the selector and rule configuration, see [Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule) .
+* Support traffic management based on host, uri, query and other request information.
+* Supports setting load balancing policies for requests and also supports service warm-up, currently supports three policies: ip hash (consistent hashing with virtual nodes), round-robbin (weighted polling), random (weighted random).
+* Support setting interface level request timeout time.
+* Support setting the number of timeout retries.
-Add the following dependencies to the gateway's `pom.xml` file:
+## 1.4 Plugin code
-```xml
-
-
- org.apache.shenyu
- shenyu-spring-boot-starter-plugin-websocket
- ${project.version}
-
+* Core Module ```shenyu-plugin-websocket```.
+* Core Class ```org.apache.shenyu.plugin.websocket.WebSocketPlugin```.
-```
+## 1.5 Added Since Which shenyu version
+
+- 2.4.1
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+![image-20220726223545558](/img/shenyu/plugin/websocket/procedure_chart_en.png)
+
+**Explanation of terms**
+- Shenyu gateway service:Include shenyu-admin and shenyu-bootstrap services.
+- Client services:Real backend websocket service.
+
+**Explanation of the process**
+1. Start shenyu gateway service: Refer to the deployment, start shenyu-admin and shenyu-bootstrap to make sure shenyu gateway service is normal.
+2. Enable the websocket plugin in shenyu-admin: Turn on the websocket plugin in the shenyu-admin plugin management page.
+3. Configure and start the client service: start the client project (real websocket service on the back end) and configure the service information into the shenyu gateway, in two ways: manual configuration and automatic configuration.
+4. Check if forwarding is normal: Check if forwarding is successful.
+
+## 2.2 Enable plugin
+
+- In shenyu-admin --> BasicConfig --> Plugin --> websocket is set to on.
+
+![image-20220726224444058](/img/shenyu/plugin/websocket/enable_websocket_en.png)
+
+
+## 2.3 Client Services configuration
+
+### 2.3.1 Manual configuration
+
+> Manually configure the client service on the shenyu-admin page, and the backend service will implement the websocket protocol forwarding without any changes.
+
+1. Adding selectors to the websocket plugin.
-## Request Path
+![image-20220726225217950](/img/shenyu/plugin/websocket/add_selector_en.png)
-When using Apache ShenYu proxy websocket, assume that the request path is:
+2. Add rules to the websocket plugin.
+![image-20220726225315550](/img/shenyu/plugin/websocket/add_rule_en.png)
+
+3. Start the client service (backend websocket service).
+
+4. Test the success of service forwarding.
+
+- See Annex 5.1 for the test code.
+
+![image-20220726222003131](/img/shenyu/plugin/websocket/test_result_en.png)
+
+### 2.3.2 Automatic configuration
+
+> If there are scenarios where you need to automate configuration to reduce workload, you can add annotations to the backend service to automate the configuration of the service to the shenyu gateway.
+
+1. Add the plugin maven configuration to the pom.xml file in the backend service project.
+
+```xml
+
+ org.apache.shenyu
+ shenyu-spring-boot-starter-plugin-websocket
+ ${project.version}
+
```
-ws://localhost:9195/wesocket
+
+2. Use the `@ShenyuSpringWebSocketClient` annotation, which will automatically register the websocket service to the shenyu gateway.
+3. Adjust the plugin configuration, see 2.4.1 for details of the configuration parameters.
+4. Start the client project (the backend `websocket service), see 2.5 for sample code.
+5. Check whether the PluginList service registration information in the shenyu-admin page is registered successfully.
+6. Test the success of service forwarding.
+
+- See Annex 5.1 for the test code.
+
+![image-20220726221945414](/img/shenyu/plugin/websocket/test_result_en.png)
+
+## 2.4 Config plugin
+
+### 2.4.1 Configure access parameters in the configuration file in the client service
+
+* Client access method and server address, the parameters are: `shenyu.register.*`, the following example uses the http access method, currently the client supports the following access methods: http, zookeeper, etcd, nacos, consul, please refer to [client access configuration](.../.../user-guide/register-center-access) for detailed access configuration parameters.
+* Client configuration with the parameter: `shenyu.client.websocket.*`, containing the service name, routing address and port, and the contextPath value must be configured as the routing address for each service.
+
+```yaml
+shenyu:
+ register:
+ registerType: http
+ serverLists: http://localhost:9095
+ props:
+ username: admin
+ password: 123456
+ client:
+ websocket:
+ props:
+ contextPath: /ws-annotation
+ appName: ws-annotation
+ port: 8001 # Need to be consistent with the service port
```
+### 2.4.2 Configure the websocket plugin's selector and rule information in shenyu-admin
+
+Using auto-configuration, after the client starts it will automatically register [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) in shenyu-admin -> Plugin List -> Proxy -> Websocket information.
+![image-20220725222628106](/img/shenyu/plugin/websocket/auto_register_en.png)
+
+#### 2.4.2.1 Configuration of selectors
+
+The example of websocket selector configuration, please refer to [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) for general selector configuration.
+
+![image-20220725222913298](/img/shenyu/plugin/websocket/config_selectors_en.png)
+
+##### 2.4.2.1.1 Selector handler configuration
+
+- `host`:Fill in `localhost`, this field is not used for now.
+- `ip:port`:`ip` and port, here fill in the `ip` + port of your real service.
+- `protocol`:`ws` protocol, do not fill in the default: `ws://`.
+- `startupTime`:Start-up time in milliseconds.
+- `weight`:The default value for load balancing weight, which is automatically registered for service startup, is 50.
+- `warmupTime`:Warm-up time, in milliseconds, the server in warm-up will calculate the instantaneous weight, the calculated value will be less than the actual weight configured to protect the server just started, the default value of service start registration is 10. For example, the warm-up time is 100 milliseconds, currently started 50 milliseconds, the configured weight is 50, the actual weight is 25.
+- `status`:open or close, the start state of this processor is only valid.
+
+#### 2.4.2.2 Configuration of rules
+
+The example of websocket rule configuration, please refer to [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) for general rule configuration .
+
+![image-20220725223225388](/img/shenyu/plugin/websocket/config_rules_en.png)
+
+##### 2.4.2.2.1 Rule handler configuration
+
+- `loadStrategy`: if the websocket client is a cluster, which load balancing strategy to take when the Apache ShenYu gateway is invoked, currently supports roundRobin, random and hash.
+- `timeout`: The timeout period for calling the client.
+- `retryCount`: The number of retries to call client timeout failures.
+
+## 2.5 示例
+
+### 2.5.1 Spring Annotation Websocket Example
+
+[shenyu-example-spring-annotation-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-annotation-websocket)
+
+### 2.5.2 Spring Native Websocket Example
+
+[shenyu-example-spring-native-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket)
+
+### 2.5.3 Spring Reactive Websocket Example
+
+[shenyu-example-spring-reactive-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket)
+
+# 3. How to disable plugin
+
+- shenyu-admin --> BasicConfig --> Plugin --> Close websocket plugin status.
+
+![image-20220726231206572](/img/shenyu/plugin/websocket/close_websocket_en.png)
+
+# 4. Frequently Asked Questions
+
+**4.1 Websocket connection establishment error 1002**
+
+Possible causes: client service is not normal, shenyu gateway and client project can not establish a normal connection, please check the gateway to the client network, client service is normal.
+
+**4.2 Multiple client services are displayed as empty in the websocket selector**
+
+Possible cause: BasicConfig -> Plugin -> websocket -> multiSelectorHandle option select multiple handle.
+
+![image-20220726222250136](/img/shenyu/plugin/websocket/questions_multiSelectorHandle_en.png)
+
+# 5. Annexes
+
+## 5.1 websocket debugging code
+
+- Create a file called websocket.html and copy the following code into the file.
+- Open websocket.html with Chrome.
+
+```html
+
+
+
+
+ Shenyu WebSocket Test
+
+
+
+
+
+
+
+
+
+
+
+
+```
diff --git a/versioned_docs/version-2.4.3/plugin-center/proxy/websocket-plugin.md b/versioned_docs/version-2.4.3/plugin-center/proxy/websocket-plugin.md
index b07f851e221..292571a3e84 100644
--- a/versioned_docs/version-2.4.3/plugin-center/proxy/websocket-plugin.md
+++ b/versioned_docs/version-2.4.3/plugin-center/proxy/websocket-plugin.md
@@ -1,38 +1,277 @@
---
-title: WebSocket Plugin
-keywords: ["WebSocket"]
-description: websocket plugin
+title: Websocket Plugin
+keywords: ["Websocket"]
+description: Websocket Plugin
---
+# 1. Overview
-The Apache ShenYu gateway implements support for the WebSocket proxy.
+## 1.1 Plugin Name
+* Websocket Plugin.
-## Environment to prepare
+## 1.2 Appropriate Scenario
-Please refer to the deployment to select a way to start shenyu-admin. For example, start the Apache ShenYu gateway management system through [local deployment](../../deployment/deployment-local) .
+* Forwarding scenarios, processing websocket protocol requests and forwarding them to other websocket protocol services on the backend.
+* Service Load Balancing.
-After successful startup, you need to open the Websocket plugin on in the BasicConfig `->` Plugin. For `Websocket` plugin details.
+## 1.3 Plugin functionality
-You can see it in PluginList -> rpc proxy -> Websocket. For details about the selector and rule configuration, see [Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule) .
+* Support traffic management based on host, uri, query and other request information.
+* Supports setting load balancing policies for requests and also supports service warm-up, currently supports three policies: ip hash (consistent hashing with virtual nodes), round-robbin (weighted polling), random (weighted random).
+* Support setting interface level request timeout time.
+* Support setting the number of timeout retries.
-Add the following dependencies to the gateway's `pom.xml` file:
+## 1.4 Plugin code
-```xml
-
-
- org.apache.shenyu
- shenyu-spring-boot-starter-plugin-websocket
- ${project.version}
-
+* Core Module ```shenyu-plugin-websocket```.
+* Core Class ```org.apache.shenyu.plugin.websocket.WebSocketPlugin```.
-```
+## 1.5 Added Since Which shenyu version
+
+- 2.4.1
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+![image-20220726223545558](/img/shenyu/plugin/websocket/procedure_chart_en.png)
+
+**Explanation of terms**
+- Shenyu gateway service:Include shenyu-admin and shenyu-bootstrap services.
+- Client services:Real backend websocket service.
+
+**Explanation of the process**
+1. Start shenyu gateway service: Refer to the deployment, start shenyu-admin and shenyu-bootstrap to make sure shenyu gateway service is normal.
+2. Enable the websocket plugin in shenyu-admin: Turn on the websocket plugin in the shenyu-admin plugin management page.
+3. Configure and start the client service: start the client project (real websocket service on the back end) and configure the service information into the shenyu gateway, in two ways: manual configuration and automatic configuration.
+4. Check if forwarding is normal: Check if forwarding is successful.
+
+## 2.2 Enable plugin
+
+- In shenyu-admin --> BasicConfig --> Plugin --> websocket is set to on.
+
+![image-20220726224444058](/img/shenyu/plugin/websocket/enable_websocket_en.png)
+
+
+## 2.3 Client Services configuration
+
+### 2.3.1 Manual configuration
+
+> Manually configure the client service on the shenyu-admin page, and the backend service will implement the websocket protocol forwarding without any changes.
+
+1. Adding selectors to the websocket plugin.
-## Request Path
+![image-20220726225217950](/img/shenyu/plugin/websocket/add_selector_en.png)
-When using Apache ShenYu proxy websocket, assume that the request path is:
+2. Add rules to the websocket plugin.
+![image-20220726225315550](/img/shenyu/plugin/websocket/add_rule_en.png)
+
+3. Start the client service (backend websocket service).
+
+4. Test the success of service forwarding.
+
+- See Annex 5.1 for the test code.
+
+![image-20220726222003131](/img/shenyu/plugin/websocket/test_result_en.png)
+
+### 2.3.2 Automatic configuration
+
+> If there are scenarios where you need to automate configuration to reduce workload, you can add annotations to the backend service to automate the configuration of the service to the shenyu gateway.
+
+1. Add the plugin maven configuration to the pom.xml file in the backend service project.
+
+```xml
+
+ org.apache.shenyu
+ shenyu-spring-boot-starter-plugin-websocket
+ ${project.version}
+
```
-ws://localhost:9195/wesocket
+
+2. Use the `@ShenyuSpringWebSocketClient` annotation, which will automatically register the websocket service to the shenyu gateway.
+3. Adjust the plugin configuration, see 2.4.1 for details of the configuration parameters.
+4. Start the client project (the backend `websocket service), see 2.5 for sample code.
+5. Check whether the PluginList service registration information in the shenyu-admin page is registered successfully.
+6. Test the success of service forwarding.
+
+- See Annex 5.1 for the test code.
+
+![image-20220726221945414](/img/shenyu/plugin/websocket/test_result_en.png)
+
+## 2.4 Config plugin
+
+### 2.4.1 Configure access parameters in the configuration file in the client service
+
+* Client access method and server address, the parameters are: `shenyu.register.*`, the following example uses the http access method, currently the client supports the following access methods: http, zookeeper, etcd, nacos, consul, please refer to [client access configuration](.../.../user-guide/register-center-access) for detailed access configuration parameters.
+* Client configuration with the parameter: `shenyu.client.websocket.*`, containing the service name, routing address and port, and the contextPath value must be configured as the routing address for each service.
+
+```yaml
+shenyu:
+ register:
+ registerType: http
+ serverLists: http://localhost:9095
+ props:
+ username: admin
+ password: 123456
+ client:
+ websocket:
+ props:
+ contextPath: /ws-annotation
+ appName: ws-annotation
+ port: 8001 # Need to be consistent with the service port
```
+### 2.4.2 Configure the websocket plugin's selector and rule information in shenyu-admin
+
+Using auto-configuration, after the client starts it will automatically register [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) in shenyu-admin -> Plugin List -> Proxy -> Websocket information.
+![image-20220725222628106](/img/shenyu/plugin/websocket/auto_register_en.png)
+
+#### 2.4.2.1 Configuration of selectors
+
+The example of websocket selector configuration, please refer to [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) for general selector configuration.
+
+![image-20220725222913298](/img/shenyu/plugin/websocket/config_selectors_en.png)
+
+##### 2.4.2.1.1 Selector handler configuration
+
+- `host`:Fill in `localhost`, this field is not used for now.
+- `ip:port`:`ip` and port, here fill in the `ip` + port of your real service.
+- `protocol`:`ws` protocol, do not fill in the default: `ws://`.
+- `startupTime`:Start-up time in milliseconds.
+- `weight`:The default value for load balancing weight, which is automatically registered for service startup, is 50.
+- `warmupTime`:Warm-up time, in milliseconds, the server in warm-up will calculate the instantaneous weight, the calculated value will be less than the actual weight configured to protect the server just started, the default value of service start registration is 10. For example, the warm-up time is 100 milliseconds, currently started 50 milliseconds, the configured weight is 50, the actual weight is 25.
+- `status`:open or close, the start state of this processor is only valid.
+
+#### 2.4.2.2 Configuration of rules
+
+The example of websocket rule configuration, please refer to [selectors and rules](../../user-guide/admin-usage/selector-and-rule.md) for general rule configuration .
+
+![image-20220725223225388](/img/shenyu/plugin/websocket/config_rules_en.png)
+
+##### 2.4.2.2.1 Rule handler configuration
+
+- `loadStrategy`: if the websocket client is a cluster, which load balancing strategy to take when the Apache ShenYu gateway is invoked, currently supports roundRobin, random and hash.
+- `timeout`: The timeout period for calling the client.
+- `retryCount`: The number of retries to call client timeout failures.
+
+## 2.5 示例
+
+### 2.5.1 Spring Annotation Websocket Example
+
+[shenyu-example-spring-annotation-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-annotation-websocket)
+
+### 2.5.2 Spring Native Websocket Example
+
+[shenyu-example-spring-native-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket)
+
+### 2.5.3 Spring Reactive Websocket Example
+
+[shenyu-example-spring-reactive-websocket](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket)
+
+# 3. How to disable plugin
+
+- shenyu-admin --> BasicConfig --> Plugin --> Close websocket plugin status.
+
+![image-20220726231206572](/img/shenyu/plugin/websocket/close_websocket_en.png)
+
+# 4. Frequently Asked Questions
+
+**4.1 Websocket connection establishment error 1002**
+
+Possible causes: client service is not normal, shenyu gateway and client project can not establish a normal connection, please check the gateway to the client network, client service is normal.
+
+**4.2 Multiple client services are displayed as empty in the websocket selector**
+
+Possible cause: BasicConfig -> Plugin -> websocket -> multiSelectorHandle option select multiple handle.
+
+![image-20220726222250136](/img/shenyu/plugin/websocket/questions_multiSelectorHandle_en.png)
+
+# 5. Annexes
+
+## 5.1 websocket debugging code
+
+- Create a file called websocket.html and copy the following code into the file.
+- Open websocket.html with Chrome.
+
+```html
+
+
+
+
+ Shenyu WebSocket Test
+
+
+
+
+
+
+
+
+
+
+
+
+```