I just started working on WebMatrix 2 recently, I’ve been reading that socket.io is a great tool to send and receive events in my application.
The thing is I’m completely new to socket.io and I don’t know where can I install it, I tried NugGet but I can’t find a helper that offers the support for socket.io. I read that I should create a project from the Node.js templates but I want to work on ASP.NET and I’m not familiar with Node.js.
How can I install socket.io into my WebMatrix? What are the guidelines to use socket.io in a ASP.NET project?
Any help will be appreciated. Thanks in advance.
You’re a little turned around 🙂 Socket.io is a NPM module that’s used with nodejs. This is different from writing an ASP.NET Web Pages site. If you want to use socket.io, you need to be using node. The Node Starter site in WebMatrix has an example of using socket.io to do a basic chat app. To see how to use this:
http://www.youtube.com/watch?v=aUT0ez6B-5w
If you would like to use ASP.NET, you should be using SignalR. Here’s a good tutorial to get you started:
http://www.mikesdotnetting.com/Article/206/SignalR-And-Knockout-In-ASP.NET-Web-Pages-Using-WebMatrix
You can also check out this video:
http://channel9.msdn.com/Shows/Web+Camps+TV/WebcampsTV-Justin-and-Vishal-Build-an-Image-sharing-Site-with-Windows-Azure-Web-Sites
Happy Coding!