-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add separate websocket example #344
Add separate websocket example #344
Conversation
Thanks for the contribution @loganmay! I propose to replace the previous HTTP-based solution because it's very restictive. Could you change the existing example to use your WebSocket-based code? You need to sign the Eclipse Contributor Agreement and sign-off your commit (with |
cb81757
to
1f762a4
Compare
@spoenemann replaced the previous solution, signed the agreement, and signed-off the commit |
Signed-off-by: Logan May <[email protected]>
1f762a4
to
cc2b56e
Compare
examples/server/server-app.ts
Outdated
const diagramServer = new DiagramServer(async (action: Action) => { | ||
const msg = JSON.stringify({ clientId: incomingMessage.clientId, action }); | ||
socket.send(msg); | ||
}, services); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposal: define the DiagramServer outside the message handler (but inside the connection handler). That way it stays the same server instance as long as the connection remains open, which is relevant in more complex cases where the server might send updates to the client.
Signed-off-by: Logan May <[email protected]>
Signed-off-by: Logan May <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WebSocket URL needs to be fixed to run in Gitpod, but I'll do that afterwards.
Switch distributed example to websockets