You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to soc...@googlegroups.com
I am using SockJS-client. SockJS constructor takes a relative URL as
var ws= new SockJS('/spring-websocket-test/sockjs/echo', undefined, {protocols_whitelist: [transport]});
Where do we indicate that WSS:// be used instead of WS://. If I try absolute URL, it gives error :
XMLHttpRequest cannot load ws://localhost:8080/appname/app. Cross origin requests are only supported for HTTP.
_ws_onclose. wasClean: false code: 1002 reason: Can't connect to server
Not sure why getting this error. Any similar configuration needed on Spring Server Implementation?
Chandan Pandey
unread,
Sep 16, 2013, 10:23:41 AM9/16/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to soc...@googlegroups.com
I went through the client code -sock JS takes care of it -if its HTTPS it uses WSS else it does WS
var that = this; var url = trans_url + '/websocket'; if (url.slice(0, 5) === 'https') { url = 'wss' + url.slice(5); } else { url = 'ws' + url.slice(4); }
Also I noticed that it adds "/websocket" for connecting to the server. I was writing a Java based client (for load tests) using Jetty websocket-client and when I passed URL for my WS location, it would never connect! Addning "/websocket" at the end of URL solved it, either I have missed it else I think its not documented anywhere -seems a good point to be documented.