private void masterCheck() {
        if (LOG.isDebugEnabled()) {
            LOG.debug("master checking task start...");
        }
        if (CollectionUtils.isEmpty(clients)) {
            List<String> urls = websocketConfig.getUrls();
            for (String url : urls) {
                if (StringUtils.isNotEmpty(websocketConfig.getAllowOrigin())) {
                    Map<String, String> headers = ImmutableMap.of(ORIGIN_HEADER_NAME, websocketConfig.getAllowOrigin());
                    clients.add(new ShenyuWebsocketClient(URI.create(url), headers, Objects.requireNonNull(pluginDataSubscriber), metaDataSubscribers,
                            authDataSubscribers, proxySelectorDataSubscribers, discoveryUpstreamDataSubscribers, namespaceId));
                } else {
                    clients.add(new ShenyuWebsocketClient(URI.create(url), Objects.requireNonNull(pluginDataSubscriber),
                            metaDataSubscribers, authDataSubscribers, proxySelectorDataSubscribers, discoveryUpstreamDataSubscribers, namespaceId));
                }
            }
        }
        Iterator<ShenyuWebsocketClient> iterator = clients.iterator();
        while (iterator.hasNext()) {
            ShenyuWebsocketClient websocketClient = iterator.next();
            if (!websocketClient.isOpen()) {
                iterator.remove();
                continue;
            }
            String runningMode = websocketClient.getRunningMode();
            // check running mode
            if (Objects.equals(runningMode, RunningModeEnum.STANDALONE.name())) {
                LOG.info("admin running in standalone mode...");
                timerTask.cancel();
                return;
            }
            
            if (!websocketClient.isConnectedToMaster()) {
                websocketClient.nowClose();
                iterator.remove();
            }
        }
    }
Instantiates a new Websocket sync cache.

@param websocketConfig the websocket config
@param shenyuConfig the shenyu config
@param pluginDataSubscriber the plugin data subscriber
@param metaDataSubscribers the meta data subscribers
@param authDataSubscribers the auth data subscribers
@param proxySelectorDataSubscribers the proxy selector data subscribers
@param discoveryUpstreamDataSubscribers the discovery upstream data subscribers
shenyu-sync-data-center/shenyu-sync-data-websocket/src/main/java/org/apache/shenyu/plugin/sync/data/websocket/WebsocketSyncDataService.java