PatrickJS/angular-websocket

Relative url

mburger81 opened this issue · 3 comments

Hi, a question, how can I set the websocket path realtive and not absolut.

ws://api/v1.... does not work

Is it possible also the set wss or ws dynamically? It depends from where I came if I came over https or http.

thx

no idea?

Post "a little" old, but maybe a Regex solution in case of browser uses:
window.location.href.replace(/http(s?)/, 'ws$1')

Like this:
var ws = $websocket(window.location.href.replace(/http(s?)/, 'ws$1'));

I'm going close this issue because we are using another websocket implementation instead of this!