Browse Source

websocket simple example

cloud-keycloak
aidar 3 years ago
parent
commit
1c54a931ca
1 changed files with 16 additions and 1 deletions
  1. +16
    -1
      demo-client-app/src/App.js

+ 16
- 1
demo-client-app/src/App.js View File

@ -16,9 +16,24 @@ const connect = async (token) => {
{"X-Authorization": token},
(frame) => {
console.log("Connected", frame);
const requestUrl = "/app/simple";
let params = {
tratata: 1,
gratata: 0
}
stomp.send(
requestUrl,
JSON.stringify(params)
);
stomp.subscribe("/user/simple", (results, errors)=>{
console.log("results: ", results);
console.log("errors: ", errors);
});
},
error => {
console.error("Disconnected");
console.error("Disconnected: ", error);
}
);
}


Loading…
Cancel
Save