This is what i want
But this is what i get:
Here is my code:
function App() {
const greeting = 'Hello Function Component!';
const socket = new WebSocket('ws://192.168.99.9/video');
socket.binaryType = 'arraybuffer';
socket.onopen = (event) => console.log('Video connected');
socket.onmessage = (event) => {
// Show the Binary messages
console.log('Testing:')
console.log(event.data)
}
return <h1> {greeting} </h1>;
}
export default App;
The WebSocket connection is created successfullly, but i still not get the binary messages. I thought when the connection established, i would get the messages.
where i did wrong