mirror of https://github.com/Ale32bit/Soqet.git
Compare commits
2 Commits
dff0d92474
...
bb229bbcf8
Author | SHA1 | Date |
---|---|---|
Alessandro Proto | bb229bbcf8 | |
Alessandro Proto | a429efb0a4 |
|
@ -5,7 +5,6 @@
|
|||
"enableWebsocket": true,
|
||||
"enableTCPSocket": true,
|
||||
"enablePolling": true,
|
||||
"wildcardChannel": "*",
|
||||
"pollingInterval": 3600,
|
||||
"enablePrometheus": true
|
||||
}
|
||||
|
|
|
@ -186,7 +186,6 @@
|
|||
<h3>Opening a channel</h3>
|
||||
<div class="sub">
|
||||
<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>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
|
|
|
@ -41,7 +41,6 @@ export interface Server {
|
|||
enableWebsocket: boolean,
|
||||
enableTCPSocket: boolean,
|
||||
enablePolling: boolean,
|
||||
wildcardChannel: string,
|
||||
pollingInterval: number,
|
||||
enablePrometheus: boolean,
|
||||
},
|
||||
|
|
20
src/index.ts
20
src/index.ts
|
@ -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
|
||||
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 {
|
||||
ok: true,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue