nativescript-websockets
nativescript-websockets copied to clipboard
support for http redirects
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.
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...
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.