1
v-vp
4y

Has anyone developed websocket server in Nodejs?

I am planning to use socketcluster. Has anyone had experience using it? Is it good or should I go for something else?

Comments
  • 3
    Did that way back with Socket.io. don't know if that is still the best way too go but I will be following this thread as I will have to do it again soon :)
  • 1
    Socket.io is really popular and you get lot of help online with it. But in case of socketcluster and other libraries I found, I don't see much questions being answered on the internet.

    Also socketcluster seems like it's not actively developed right now. Commits are not that frequent. The client libraries have not been updated in over two years. So I am not really sure if I should go for socketcluster because I don't want to run into some problem especially on the client side (like a security issue) and then bang my head over it and try to fix it myself.
  • 0
    If it's not actively maintained I wouldn't touch it with a ten feet pole if there was another way of doing it that is actually being maintained and there is an active community on it. It will save a lot of headaches
  • 2
    I recommend socket.io the ease of use is incredible.
  • 2
    Also recommending socket.io.
    It's an absolute pleasure to work with.
  • 0
    It'll work well but don't use promises or async/await.

    Stick to old school callbacks instead as promises in JS and async/await are completely screwed up.
  • 1
    I also would advocate for using socket.io

    We use it at work and also in all of my own projects for its ease of use and also the wealth of information on it aka StackOverflow posts.
  • 2
    I like socket.io
  • 1
    I've used socket.io with this as well!
  • 0
    After doing some research on socket.io I have found out following things.

    1. If u are writing an app that does not have to scale to huge number of users then socket.io is definitely very helpful as it reduces development time.
    2. Socketi.io is bloated. It has abstractions over abstractions (which makes sense since it supports fallbacks and channel abstractions). So the performance is not really that great at high levels of concurrency. Source: https://itnext.io/efficient-pub-sub...
    http://drewww.github.io/socket.io-b...
    3. If you don't need long polling support then not using socket.io would be better as it will remove overheads associated with socket.io long polling.
    4. The socket.io repo has 424 open issues but the commit frequency is very low.
    5. Socket.io clients repos are essentially dead. So if you have any major issues with client libs then you are screwed. You cannot use websockets client libs as they wont support socket.io directly.
  • 0
    I feel websockets/ws library is the best option. Socket.io basically is an abstraction over ws module. The ws module will give more control and performance with a disadvantage that you will have to write logic for channels and other abstractions that you might need in your application.
Add Comment