Compare commits

..

2 Commits

Author SHA1 Message Date
Alessandro Proto bb229bbcf8
Merge pull request #1 from Ale32bit/drop-wildcard-channel
Remove support for wildcard channel
2022-02-02 08:48:55 +01:00
Alessandro Proto a429efb0a4 Removed support for wildcard channels 2022-02-01 12:26:37 +01:00
4 changed files with 0 additions and 23 deletions

View File

@ -5,7 +5,6 @@
"enableWebsocket": true, "enableWebsocket": true,
"enableTCPSocket": true, "enableTCPSocket": true,
"enablePolling": true, "enablePolling": true,
"wildcardChannel": "*",
"pollingInterval": 3600, "pollingInterval": 3600,
"enablePrometheus": true "enablePrometheus": true
} }

View File

@ -186,7 +186,6 @@
<h3>Opening a channel</h3> <h3>Opening a channel</h3>
<div class="sub"> <div class="sub">
<p>Opening channels allows the receiving of messages from other clients.</p> <p>Opening channels allows the receiving of messages from other clients.</p>
<p>The <b>Wildcard</b> to listen to all channels is <code>*</code>.</p>
<table> <table>
<tr> <tr>
<th>Field</th> <th>Field</th>

View File

@ -41,7 +41,6 @@ export interface Server {
enableWebsocket: boolean, enableWebsocket: boolean,
enableTCPSocket: boolean, enableTCPSocket: boolean,
enablePolling: boolean, enablePolling: boolean,
wildcardChannel: string,
pollingInterval: number, pollingInterval: number,
enablePrometheus: boolean, enablePrometheus: boolean,
}, },

View File

@ -114,11 +114,6 @@ function transmitMessage(sessionId: string, channel: string | number, message: a
} }
} }
if (channel === config.wildcardChannel) return {
ok: false,
error: config.wildcardChannel + " is read-only",
}
// Build the message meta // Build the message meta
let meta: MetaMessage = (rawMeta || {}) as MetaMessage; let meta: MetaMessage = (rawMeta || {}) as MetaMessage;
@ -152,21 +147,6 @@ function transmitMessage(sessionId: string, channel: string | number, message: a
}) })
} }
// Send message to wildcard channel
let wildcardChannelArray = server.channels[config.wildcardChannel];
if (wildcardChannelArray) {
wildcardChannelArray.forEach(recipientId => {
server.clients[recipientId]?.send({
type: "message",
channel: config.wildcardChannel,
message: message,
meta: meta,
})
server.prometheus.messagesTrafficCounter.labels('outgoing').inc();
})
}
return { return {
ok: true, ok: true,
}; };