8 ms·
Show HN: Run your own Push/Pull service for free using node.js + socket.io
- iloveponies 15y agoDespite this and others like Socket.io, Pusher still appears to be popular and doing well. How come?
- daraosn 15y agoIf you can make it by yourself and for free, why not? This uses socket.io, it just makes it easier for you to mount your own push/pull service.
- SeanOC 15y agoSame reason most infrastructure as a service companies exist. Setting up, maintaining, and scaling web socket messaging servers isn't my core business. Accordingly I am happy to pay a reasonable fee to somebody like Pusher to have the problem go away. If real-time messaging is core/fundamental to your business, then you probably should run your own servers. Otherwise let somebody else deal with that bit of complexity and focus on the parts of your business that matter most.
- bhuga 15y agoIt's cheap, it's already working in my project, it has a nice test stub, automatic reconnections, flash fallback for older browsers, support is responsive and effective, even when it's my fault. The many toy pusher clones need to worry about the 90% of a project that is the polish before pusher will go away.
- Argorak 15y agoFor what its worth: if you want to have your own pusher, you can use Slanger. https://github.com/stevegraham/slanger https://github.com/stevegraham/slanger It works with most (if not all) pusher libs and is rather convenient (except the "run on your own infrastructure" part).
- djb_hackernews 15y agoI also built my own Pusher compatible clone, https://github.com/danbeaulieu/PushPlay https://github.com/danbeaulieu/PushPlay which is built on the Play! framework. Not recommended for production deployments, yet.
- daraosn 15y agocool alternatives, was looking for this some months ago for Ruby, watching on gh
- peteforde 15y agoThere is nothing free about managing and supporting a complex infrastructure component. When you're building out an already sophisticated application, and your core user value proposition has nothing to do with providing subscribed socket connections then it is suddenly a real joy to pay real money to a competent vendor that takes responsibility for something that is hard to get right. Tech startups are 10% software and 90% running a business. Pusher helps me run my business.
- peteforde 15y agoAs an addendum, my investors and board appreciate this thinking. "I can do all of this myself" is a common ego trap that precedes cowboy mentality. Running a socket stack sounds like fun until something goes wrong at 3am.
- daraosn 15y agoThis took 5 hours of coding and it's been running 2 months without problems, where is the complexity of it?? I agree your point when you talk about really complex stuff, but something that be done in that amount time doesn't worth to be outsourced in my opinion. Also it's good to have alternatives, that's how we make things better.
- catshirt 15y agohow many messages are you sending, to how many clients? likewise, how are you running a public node server for free? how many of these servers are you running? what if... etc, etc. not dismissing your library, but sounds like a case of "i don't know what i don't know". pusher exists as a service for a reason. there's a bit more to it than pushing json around.
- rlivsey 15y agoPusher costs ~$49/month, my time is worth $1000/hour [1] It took me about 5 minutes to setup Pusher and for that I get private channels, presence, someone to handle the scaling etc... as djb_hackernews already mentioned. We outsource DNS, email, hosting infrastructure, anything I possibly can which isn't core to the product itself. The question shouldn't be why outsource this, the question is why would it be worth our time writing and supporting it ourselves when we can be working on other things? Maybe we'll insource this stuff when we're at a point where we hit the 'enterprise' plan on Pusher, when we have a few more developers and a dedicated sys-admin. I'll cross that bride then, in the meantime I'm happy to have a $49/m hit on my credit card and move onto the next thing! All that aside, it's great to have options so thanks for releasing this! [1] - http://blog.asmartbear.com/value-time.html http://blog.asmartbear.com/value-time.html
- pasaba 15y agoPretty friggin awesome man!
- ilaksh 15y agoWhy do people use socket.io instead of Now.js?
- djb_hackernews 15y agoNice work. To be fair, you should list the things it can't do that Pusher can before you advise people to forget it. It looks like node-puller: * Doesn't scale * Doesn't have authentication * Doesn't have private channels * Can't do presence
- daraosn 15y agoNot yet... I shared this for two reasons, because is an open-source project and so anyone can contribute to implement what is missing. Thanks, will include your list in the README.
- sjtgraham 15y agoNeeds test coverage if you want it to be a serious alternative to Pusher. Nice work.
- angersock 15y agoCongratulations on a cool project! There seem to be a lot of people here who are wondering why you bothered doing this instead of buying/renting/paying for some other solution. I'd suggest quietly acknowledging their points, and then going back to working on cool things. Be an engineer. Be a problem-solver. Be a thinker. Don't worry about some magical valuation of your time and how learning to roll-your-own is just cowboy development--that's bullshit the suits will feed you to try and make you reliant on their capital. Do the hard things, and you'll go far. (oh, and look into em-websockets...some cool stuff there if you don't want to mess with a full Rails deployment)
- peteforde 15y agoYou busted me! I'm a suit: https://vimeo.com/4031833 https://vimeo.com/4031833 I fail to understand how delegation is not problem solving, but I know that it is most certainly smart business. Engineers need to manage their time and their priorities, and building a socket queue is a solved problem if you let it be. Why not spend that energy on UX?
- angersock 15y agoSir, you have fantastic moves. :) About UX: that's an issue for the designers, yeah? I imagine the wheel-reinvention should be left to your engineers. In general, I'd agree with you delegation is a good idea, but if you look at the site for the OP, it's a hackathon site. My assumption is that daraosn is more on the dev side of the dev-biz spectrum. It's really counterproductive and harmful to the dev ecosystem to keep pointing out that whatever we're working on, well, it already exists, and we just have to pay for it and move on. That's just my opinion, mind you, but I hope some share it. At the end of the day, we already have operating systems. And web stacks. And programming languages. Anything you pick, anything at all you use for your business, has probably been done before and probably better. We stand on the shoulders of giants. That said, it's important sometimes to reinvent the wheel. It's important to scratch tech itches, even if your biz guys are breathing down your neck and trying to convince you that you're wasting time and investor money. The big problem I have, as a developer, is that there are a lot of paid services to solve problems. But, sometimes, they don't work, or they have bad APIs, or they get acquired and go away. Moreover, every time I outsource part of my stack, I'm reinforcing to the biz guys "Hey, us devs? Yeah, we're just cogs. Find somebody else to replace my sliver of logic integrating all these off-the-shelf APIs. I'm not really that important." How much progress in tech has been made by people reinventing the wheel?
- rohitnair 15y agoKudos for sharing this and showing how easy it is to use node.js and socket.io (for those who haven't tried out socket.io, you really should) I implemented something similar for my side project recently, but instead of using an HTTP end point, I used redis and it's in built pub/sub layer. Pushing events is then a simple matter of publishing messages on redis channels. My node.js code listens to these redis channels and pushes the events upstream to the browsers via websockets, exactly as you do. Another thing I'd suggest you to highlight (or rather warn) is your use of eval. In the use cases you've mentioned (message board or chat room), you're essentially going to eval user input. Any attacker who knows this will most definitely try to perform XSS.