Websocket on top of express #94
Closed
MaheshkumarSundaram
started this conversation in
General
Replies: 1 comment
-
In your app.ts add similar code: this.bpmnServer.appDelegate.winSocket = wss; from your appDelegate, you can now access wss |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @ralphhanna
I would like to use websocket on top of the express in
bpmn-server
. As part of workflows, I would like to send messages to clients when necessary.I did the following changes:
Change 1:
I created a
WebSocketServer.ts
:Change 2:
I added an upgrade event listener to handle WebSocket upgrade requests on top of
Express
inapp.ts
:Change 3:
Then I used the singleton instance of
WebSocketServer
inappDelegate.ts
to use web socket inside Services.Websocket starts fine and I tested the connection from client side, it works.
Does my approach have any major pitfalls or vulnerabilities?
If any improvements could eb made, kindly suggest.
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions