PatrickJS / angular-websocket

:arrow_upper_left: The missing Angular WebSocket module for connecting client applications to servers by @AngularClass
https://angularclass.github.io/angular-websocket
MIT License
1.22k stars 195 forks source link

Relative url #65

Closed mburger81 closed 7 years ago

mburger81 commented 8 years ago

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

mburger81 commented 8 years ago

no idea?

gurmiguel commented 7 years ago

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'));

mburger81 commented 7 years ago

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