swissmanu / primus-responder

Request-Response ortiented communication for websockets with Primus.
https://github.com/swissmanu/primus-responder
MIT License
26 stars 11 forks source link

Usage with Primus-emit plugin #10

Open ddennis opened 7 years ago

ddennis commented 7 years ago

Hi

I am currently using Primus 5.2.2 with the primus-emit plugin.

I am trying to add your plugin to an exiting project to provide better validation on user interaction in the backend.

Disabling the "primus-emit" plugin, everything seems to work fine. Are there any way these two plugins can work together? /Dennis

veggiss commented 6 years ago

This is still an issue with v7.1.1.

PlkMarudny commented 3 years ago

Looking at the code, it is really not resolvable, but adding 'request' as a reserved event name to Primus should stop "primus-emit" fro intercepting "request" event, like below:

const socket = new primus(server, { transformer: ..., parser: ... });
socket.reserved.events['request'] = 1;