background preloader

Node.js

Facebook Twitter

Token-based Authentication with Socket.IO. Introduction Authentication in realtime frameworks can be challenging.

Token-based Authentication with Socket.IO

Perhaps this is because the way these systems work is quite different from a regular web app. The risk of not correctly authenticating your sockets traffic is that you could end up sniffing information on other users streams. The socket server will not automagically know about the logged-in user, thus anyone could join any stream.

This first diagram shows this common misconception: It is a common misconception that a user who is authenticated in the hosting web appliction, is also authenticated in the socket stream. Social Authentication for Node.js Apps With Passport. It's already a well-established fact that passwords are inherently weak in nature.

Social Authentication for Node.js Apps With Passport

Thus asking end users to create strong passwords for every application they use simply makes matters worse. An easy workaround is to let users authenticate via their existing social accounts like Facebook, Twitter, Google, etc. In this article, we are going to do just that and add this social login capability to the sample Node application developed in the first part of this authentication series, so that we will be able to authenticate via our Facebook and Twitter accounts using Passport middleware.

If you have not checked out the previous article, I'd recommend that you go through it, as we will be building upon the foundation laid by that article and adding new strategies, routes and views to it. Authenticating Node.js Applications With Passport. Token-based Authentication with Socket.IO. Acl. Ether/etherpad-lite-jquery-plugin. Sequelize ∴ An easy-to-use multi sql dialect object-relationship-mapper for node.js. Sequelize ∴ An easy-to-use multi sql dialect object-relationship-mapper for node.js. Node.io Scraper. LearnBoost/kue.

Screen Scraping with Node.js. You may have used NodeJS as a web server, but did you know that you can also use it for web scraping?

Screen Scraping with Node.js

In this tutorial, we'll review how to scrape static web pages - and those pesky ones with dynamic content - with the help of NodeJS and a few helpful NPM modules. Web scraping has always had a negative connotation in the world of web development - and for good reason. In modern development, APIs are present for most popular services and they should be used to retrieve data rather than scraping.

The inherent problem with scraping is that it relies on the visual structure of the page being scraped. Scraping the Web Using Node.js. An important part of a data analyst's work is gathering data.

Scraping the Web Using Node.js

Sometimes you might get it in a nice, machine readable format (XML, JSON, CVS, you name it). Scraping · chriso/node.io Wiki. Node.io includes a robust framework for scraping data from the web.

Scraping · chriso/node.io Wiki

The primary methods for scraping data are get and getHtml, although there are methods for making any type of request, modifying headers, etc. See the API for a full list of methods. A note before you start scraping The --debug switch is your friend - use it to see the request and response headers, and whether there was an error with the request. If your scraping job is behaving unexpectedly, --debug will show you what's going on under the hood. Mikeal/request. Web scraping with Node.js. Web scraping these days is often considered a fairly well understood craft, however there are definitely some complexities that modern web sites are bringing to the table.

Web scraping with Node.js

The days of AJAX long polling, XMLHttpRequest, WebSockets, Flash Sockets etc make things a little more difficult than just your average crawler can handle. Let’s start with the basics of what we needed at Hubdoc – we are crawling bank, utilities, and credit card company web sites looking for bill amounts, due dates, account numbers, and most importantly, PDFs of most recent bills. My initial take on this problem (aside from using an expensive commercial product which we were evaluating) was that it is simple – I had done a crawling project before at MessageLabs/Symantec in Perl and it was relatively straightforward. Icodeforlove/node-requester. Become Part Of The DirectoryBug Team. About – beanstalkd.

Beanstalk is a simple, fast work queue.

About – beanstalkd

Its interface is generic, but was originally designed for reducing the latency of page views in high-volume web applications by running time-consuming tasks asynchronously. News 04 August 2014. Ayms/node-bot. Node.js IDEs. Node.js IDEs. How To Node - NodeJS. Modular web applications with Node.js and Express. Fzysqr. How to load bootstrapped models in Backbone.js while using AMD (require.js) Building a Login System in Node.js and MongoDB.

This past week I finally got around to playing with Node.js and am really impressed with how simple it was to get a server and database up and running in literally minutes.

Building a Login System in Node.js and MongoDB

Once there, I thought a good first project to explore the platform would be to try building a simple login system analogous to what I feel like I’ve built a million times in mysql & php. So after thinking about it a bit, I knew these were the basic features I wanted to implement : Login Panel Just a simple login panel with the ability to reset a lost password and of course the ability to create an account for first time users.An option to “remember me” that saves the user’s data in a local cookie allowing them to bypass the login screen whenever they revisit the site.

New Account Screen A simple form that allows a new user to set their username & password,as well as some personal data such as their real name, email and location. Account Update Screen Password Retrieval If you’d like to jump ahead : Application Structure. Node.js and socket.io multiroom chat tutorial – ps: it's mike. I’ve been meaning to update the previous chat tutorial to include multiple rooms, here it is. what i failed to cover in the previous example was how to send messages/broadcast information with socket.io. the following examples assume you define the module: var io = require('socket.io').listen(app); io.sockets.on('connection', function (socket) { .... }); from the server, emit to the client’s socket only, using the socket callback: socket.emit('function', 'data1', 'data2'); from the server, emit to everyone but the client’s socket (to broadcast a message):

DanielBaulig/sioe-demo. Let’s Make a Drawing Game with Node.js. Martin Angelov By now you have probably heard of node.js.

Let’s Make a Drawing Game with Node.js

It is an asynchronous web server built ontop of Google’s V8 JavaScript engine (the same one that makes Chrome lighning fast). Using node, you can write scalable web services in JavaScript, that can handle a huge number of simultaneous connections, which makes it perfect as the backend of games, web chats and other real time tasks. The Idea. Kof/socket.io-mongo. Nodejs-blackboard/app.js at master · gotik/nodejs-blackboard. Erickrdch/demo-chat. Socket.io and Express. Tying it all together.

Mongoose Schemas v3.3.1. If you haven't yet done so, please take a minute to read the quickstart to get an idea of how Mongoose works.

Mongoose Schemas v3.3.1

If you are migrating from 3.x to 4.x please take a moment to read the migration guide. Defining your schema.