title: How to use secure websockets with sock js
body: <p>I am using SockJS-client. SockJS constructor takes a relative URL as</p>
  
  <pre><code>var ws= new SockJS('/spring-websocket-test/sockjs/echo', undefined,{protocols_whitelist: [transport]});
  </code></pre>
  
  <p>Where do we indicate that WSS:// be used instead of WS://. If I try absolute URL, it gives error :</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Not sure why getting this error. Any similar configuration needed on Spring Server Implementation?</p>