websocket icon indicating copy to clipboard operation
websocket copied to clipboard

What websocket javascript clients do you suggest?

Open gitleet opened this issue 8 years ago • 5 comments

What javascript client's do you guys suggest we use?

Is this websocket implementation work with socket.io's client?

gitleet avatar Jan 17 '18 20:01 gitleet

This package works with any client that implements the protocol.

What javascript client's do you guys suggest we use?

Web browser: Use the browser's built-in API Node.js: No recommendation. Ask on a Node forum.

Is this websocket implementation work with socket.io's client?

Yes, but you need code that implements the Socket.io protocol. See https://godoc.org/?q=socket.io and https://godoc.org/?q=socketio for possible packages to use.

ghost avatar Jan 17 '18 21:01 ghost

Agree with Gary on the browser side. The WebSocket APIs behave very consistently across major browsers.

I have used https://github.com/websockets/ws on the Node side (and contributed some small changes) and liked it; both a client & server. On Wed, Jan 17, 2018 at 1:56 PM Gary Burd [email protected] wrote:

What javascript client's do you guys suggest we use?

Web browser: Use the browser's built-in API Node.js: I have no recommendation. Ask on a Node forum.

Is this websocket implementation work with socket.io's client?

Yes, but you need code that implements the Socket.io protocol. I do not have any recommendations for socket.io packages.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gorilla/websocket/issues/327#issuecomment-358461056, or mute the thread https://github.com/notifications/unsubscribe-auth/AABIcE0fFH09IA1M0TAEqUQKzFkjtl6yks5tLmxugaJpZM4Rh-Zb .

elithrar avatar Jan 18 '18 01:01 elithrar

I looked at some client code in the past and noticed they usually have cross-browser related code, falling back to longpoll also in case the browser doesn't support it.

I just don't want to re-invent the wheel for something like this, and was hoping you guys had some recommendations.

Thanks!

gitleet avatar Jan 18 '18 15:01 gitleet

socket.io is probably the premiere solution in that case, but browser support is extremely widespread now: https://caniuse.com/#feat=websockets On Thu, Jan 18, 2018 at 7:36 AM gitleet [email protected] wrote:

I looked at some client code in the past and noticed they usually have cross-browser related code, falling back to longpoll also in case the browser doesn't support it.

I just don't want to re-invent the wheel for something like this, and was hoping you guys had some recommendations.

Thanks!

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/gorilla/websocket/issues/327#issuecomment-358683994, or mute the thread https://github.com/notifications/unsubscribe-auth/AABIcAAiiu0cZV2vL8ukZRhWuaLr4245ks5tL2UCgaJpZM4Rh-Zb .

elithrar avatar Jan 18 '18 15:01 elithrar

Given current support for websockets, the fallback to long polling may not worth the trouble. A fallback to polling or no dynamic updates at all may be good enough depending on the application requirements and the browsers used by your users.

ghost avatar Jan 18 '18 17:01 ghost