MCPcopy
hub / github.com/soketi/soketi / events

Method events

src/http-handler.ts:266–287  ·  view source on GitHub ↗
(res: HttpResponse)

Source from the content-addressed store, hash-verified

264 }
265
266 events(res: HttpResponse) {
267 this.attachMiddleware(res, [
268 this.corkMiddleware,
269 this.jsonBodyMiddleware,
270 this.corsMiddleware,
271 this.appMiddleware,
272 this.authMiddleware,
273 this.broadcastEventRateLimitingMiddleware,
274 ]).then(res => {
275 this.checkMessageToBroadcast(res.body as PusherApiMessage, res.app as App).then(message => {
276 this.broadcastMessage(message, res.app.id);
277 this.server.metricsManager.markApiMessage(res.app.id, res.body, { ok: true });
278 this.sendJson(res, { ok: true });
279 }).catch(error => {
280 if (error.code === 400) {
281 this.badResponse(res, error.message);
282 } else if (error.code === 413) {
283 this.entityTooLargeResponse(res, error.message);
284 }
285 });
286 });
287 }
288
289 batchEvents(res: HttpResponse) {
290 this.attachMiddleware(res, [

Callers 1

configureHttpMethod · 0.80

Calls 7

attachMiddlewareMethod · 0.95
broadcastMessageMethod · 0.95
sendJsonMethod · 0.95
badResponseMethod · 0.95
markApiMessageMethod · 0.65

Tested by

no test coverage detected