Skip to content

Commit

Permalink
✨ mica-mqtt server 添加 webConfigCustomize 支持自定义 http 和 ws 配置。
Browse files Browse the repository at this point in the history
  • Loading branch information
li-xunhuan committed Nov 26, 2023
1 parent 31762e1 commit 3348bb9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,13 @@ public static MqttWebServer config(MqttServerCreator serverCreator, TioServerCon
IWsMsgHandler mqttWsMsgHandler = new MqttWsMsgHandler(serverCreator, mqttServerConfig.getTioHandler());
MqttWebServer httpServerStarter = new MqttWebServer(serverCreator, mqttServerConfig, mqttWsMsgHandler);
TioServerConfig httpTioConfig = httpServerStarter.getServerTioConfig();
// 自定义 http 和 ws 配置
BiConsumer<TioServerConfig, HttpConfig> webConfigCustomize = serverCreator.getWebConfigCustomize();
if (webConfigCustomize != null) {
webConfigCustomize.accept(httpTioConfig, httpServerStarter.getHttpConfig());
}
// 3. tcp + websocket mqtt 共享公共配置
httpTioConfig.share(mqttServerConfig);
httpTioConfig.groupStat = mqttServerConfig.groupStat;
return httpServerStarter;
}

Expand Down

0 comments on commit 3348bb9

Please sign in to comment.