```xml
<dependency>
    <groupId>org.noear</groupId>
    <artifactId>solon-server-websocket-netty</artifactId>
</dependency>
```

#### 1、描述

通讯扩展插件，基于 Netty  适配的 websocket 信号服务。可用于 Api 开发、Rpc 开发、WebSocket 开发。v2.3.5 后支持

**支持信号：**

| 信号 | 说明 | 
| -------- | -------- | 
| ws     | 默认为主端口+10000（即 `server.port` + 10000） 或 `server.websocket.port` 配置     | 


#### 2、应用示例


```java
public class DemoApp {
    public static void main(String[] args) {
        Solon.start(DemoApp.class, args, app->{
            //启用 WebSocket 服务
            app.enableWebSocket(true);
        });
    }
}

@ServerEndpoint("/ws/demo/{id}")
public class WebSocketDemo extends SimpleWebSocketListener {
    @Override
    public void onMessage(WebSocket socket, String text) throws IOException {
        socket.send("我收到了：" + text);
    }
}
```

更多内容请参考：[《Solon WebSocket 开发》](/article/332)



