nativescript-websockets icon indicating copy to clipboard operation
nativescript-websockets copied to clipboard

support for http redirects

Open tedivm opened this issue 7 years ago • 2 comments

I'm attempting to connect to a websocket, and the way the particular service works is that they'll issue a 301 redirect to a new URL and then establish the socket connection. This url is different every time (although it does follow a pattern).

Unfortunately this is causing an error to occur, as it appears this behavior isn't currently supported in this project. I also can't seem to find a way to extract the new location from the 'evt' object to attempt a new connection manually.

Any help would be appreciated.

tedivm avatar Mar 22 '17 05:03 tedivm

Well, I would use that https://github.com/yaqwsx/nativescript-simple-networking to make the initial connection then take the result and pass it to ws...

NathanaelA avatar Apr 04 '17 18:04 NathanaelA

Yeah, that works, but only if you actually know and expect a redirect is going to occur. In cases where the endpoint for a websocket is moved and a redirect put in place this feature would ensure that clients still worked.

tedivm avatar Apr 05 '17 06:04 tedivm