问题
I have created a setup where I have a back-end service that is broadcasting messages using SignalR through a SQL backplane and clients are receiving the messages through a MVC 5 + SignalR web application on a web farm. I want to intercept the messages before they get to the client from the web application and make some changes to the message, specifically return HTML to the client instead of the raw data.
I have been able to achieve this in a development environment where the messages originate from the web application (not farmed) adding a HubPipelineModule
class with an OnBeforeOutgoing
method override. However this part of the pipeline is not called when the message is broadcast from a different source (the back-end service).
Where (and how) can I hook into the SignalR pipeline to to get the OnBeforeOutgoing
method to be called when transitioning from different broadcasting sources?
来源:https://stackoverflow.com/questions/22839295/signalr-broadcast-intercept-using-pipeline-module