Open lreisoliveira opened 8 years ago
The url you're giving sockjs is incorrect. /info is a json obj, not a ws end point. And because not a websocket you can manual search for it on your browser. /info's job is to direct how SockJS actually connects to the server (whether it's though websocket, short polling, long polling or others) then sockjs does all that fun business in the back-ground while you treat it purely like a websocket.
tip: Also don't give sockJs the full url like that unless you're telling it to connect to completely different url than your base page. Just give it the basic endpoint, you'll know you've found it because when you access it through the browser you see Welcome to SockJS!
. Use that endpoint for SockJs to connect to.
This.. not work
script src="http://cdn.sockjs.org/sockjs-0.3.min.js
console.log(ws); console.log(client);
Response:
Uncaught ReferenceError: Stomp is not defined(anonymous function) @ (index):34 sockjs-0.3.min.js:27 XMLHttpRequest cannot load ws://localhost:3000/websocket/info. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
I haven't this: /info its only ws://localhost:3000/websocket
why?