NathanaelA / nativescript-websockets

Websockets for NativeScript
83 stars 43 forks source link

Very old Android implementation: lib does not pass the 'Sec-WebSocket-Protocol' header #35

Closed soulfly closed 6 years ago

soulfly commented 6 years ago

I see you use very old version of java_websocket.jar and hence this nativescript-websockets lib has some issues

1) You use the Draft_17 here https://github.com/NathanaelA/nativescript-websockets/blob/master/websockets.android.js#L223

hence this._protocol is just ignored

as a result, my server does not receive the Sec-WebSocket-Protocol header and returns an error

2) There is already the Draft_6455

https://github.com/TooTallNate/Java-WebSocket/blob/master/src/main/java/org/java_websocket/drafts/Draft_6455.java

Do you actively still support the nativescript-websockets lib ? Are you able to make this change? Do you receive PRs from other people?

NathanaelA commented 6 years ago

@soulfly - I was unaware that the original was being maintained again. Yay! When I initially grabbed my fork of the project; I had to merge a ton of patches myself to add stability.

I love to see PR's from other people! I'll add this to my list to get updated, when I have the time.

soulfly commented 6 years ago

Thanks @NathanaelA I found there is already a PR which address this issue partially https://github.com/NathanaelA/nativescript-websockets/pull/30

soulfly commented 6 years ago

I made a separate PR https://github.com/NathanaelA/nativescript-websockets/pull/36 also addressed one iOS related issue in it. @NathanaelA are you able to check it?

NathanaelA commented 6 years ago

I have accepted and merged all pull requests and then fixed the bugs that I found from them. Thanks guys!