adonisjs / adonis-websocket-client

Websocket client for AdonisJs framework.
52 stars 48 forks source link

Adonis WebSocket Client Example #65

Open mpena2099 opened 4 years ago

mpena2099 commented 4 years ago

Hi!

I'm new on NodeJS and AdonisJS but I really need an example of how to make a client (backend, not frontend) to connect to my AdonisJS websocket server. The AdonisJS + websocket server is OK.

Thanks! Mauricio

pishguy commented 3 years ago

+1

thetutlage commented 3 years ago

If you are just getting started with AdonisJS, then I recommend using v5 along with socket.io. Here's a blog post on same https://preview.adonisjs.com/blog/socketio-with-adonisjs-v5

We will eventually depreciate our Websocket implementation in favour of socket.io, since writing clients for every platform is very demanding and we want to avoid that

zhurlik commented 3 years ago

Hi, @thetutlage!

I would like to clarify whether it is possible to expect new releases with some fixes or changes in the near future. On one of the projects we are using AdonisJs 4.1. I followed the instruction from the official site AdonisJs WebSocket for running the websocket server and the websocket client in the browser. However when I decided to use the client under Worker I faced with a couple of the issues related with access to window inside the client code. I saw that some of them were fixed however I ran into them in "@adonisjs/websocket-client": "^1.0.9" that's required me to make a hot patch locally. Regarding to your last comment, does it mean that you are suggesting to switch to socket.io instead of using the approach that is allowed by AdonisJs 4.1.

Thanks, Vlad