I'm trying to connect to ws://localhost:8080 inside my React application.
The web browser I'm using is Google Chrome.
I can connect to the websocket in Postman, but on google chrome I'm getting this error:
WebSocket connection to 'ws://localhost:8080/tables' failed:.
Source code of the application is:
const ws = new WebSocket('ws://localhost:8080/tables');
ws.onmessage = function message(data: any) {
console.log('received: %s', data);
};
What am I getting wrong?