node.js

What about using a microkernel for Node.sj + NginX?

Not even sure if it would easily work but for an upcoming project I may need to set up a web sockets only server, it would not have a database, memcache or even serve static files, all it would need to do is work some logic and update other clients. The server may need to support 1~300000 clients simultaneously so Node.js+NginX makes s...

node.js POST request

i looked at the api but i could not find it. where/how should i put data on a POST request on client.request() client.requets("POST" ..)? thanks ...

Sharing a session between Node.js app and Rails app

I'm running a Rails app on Heroku, and I'm trying to port over all inline Twitter requests (namely oauth authentication) to a Node.js app, because when Twitter is slow, since the Ruby server is blocking, the Twitter requests clog up my app. (My average request takes about 50ms, but my average Twitter Oauth request takes about 1500ms!) T...

getting node.js working

So I'm following: http://giantflyingsaucer.com/blog/?p=894 and installing node.js. I got up to the part with sudo make install. It works, then it says to create a js file. What I don't understand is where I put the sayhello.js? ...

node.js install

So I'm installing node.js on amazon ec2 with ubuntu 8.04, and and have run node sayhello.js which is this code: var sys = require('sys'), http = require('http'); http.createServer(function (req, res) { setTimeout(function () { res.writeHead(200, {'Content-Type': 'text/html'}); res.write('<br/><strong>&nbsp;&nbsp;&nbsp...

How to check the number of open connections in node.js?

Hello there! I have a machine running node.js (v0.1.32) with a tcp server (tcp.createServer) and a http server (http.createServer). The http server is hit by long polling requests (lasting 50 sec each) from a comet based application on port 80. And there are tcp socket connections on port 8080 from an iphone application for the same pur...

What types of applications have you seen or made with node.js?

I'm not looking for a definition of what it is, but I'm interested in knowing what types of applications people are ( or plan to ) use it for. ...

Preferred DOM library for parsing html pages with node.js?

I'm looking for libraries that parse html pages ( with some leniency, not strict xml parsers ). Can anyone recommend any? Edit: Came across jsdom ...

$.getJSON from jQuery (in Rails app) not reading JSON from cross-domain Node.js/Express app / jsonp?

From googling/forums I think there could be two issues, neither of which I know how to fix: 1) I need to do something with the jsonp callback in the node.js request (which was generated automatically by jquery b/c of the callback=? param) - either add it to the header (where? and how?) or add it to the json response (again, where? and h...

How can I share code between Node.js and the browser?

I am creating a small application with a JavaScript client (run in the browser) and a Node.js server, communicating using WebSocket. I would like to share code between the client and the server. I have only just started with Node.js and my knowledge of modern JavaScript is a little rusty, to say the least. So I am still getting my head ...

Parse PHP Session in Javascript

Hey everyone, I have recently gone into extending my site using node.js and have come to realisation I need a session handler for my PHP sessions. Now everything was cool and dandy and node.js reads the php sessions and can propogate it's own session with the php ones. I am using database sessions so the session data gets saved into a f...

Caching Array from DB (MongoDB) in Node.js / Express.js

I wanted to add user search auto-complete (like Facebook's) to my Rails app on Heroku, and I chose to write it in Node.js because of the concurrency requirements. The search first pulls a user's friend list (of id's, which include all twitter friends, not just their friends on our site) from Mongo, then searches for users in that list, t...

Force recalculation of $(...).css("background-image") on linked stylesheet reload

Hey, long story short, (I only need functionality in Chrome) Context: I'm hacking together a node.js script that automatically watches the files it serves for changes and then uses a websocket connection to push a message to a control page in the browser that manages the reload of assets. For instance, if an html page has an <img href=...

How do I store this JSON object as a cookie and than read it in vanilla javascript?

I can actually seem to write it fine as a cookie like this: ["4c3dd477c441e17957000002","4c2ac3cc68fe54616e00002e","4c3dd477c441e17957000003","4c3dd477c441e17957000004"] But how do I read the cookie? I'm using node.js/express.js (and coffee script), and when I read it the cookie key the value I get is just the first value of the abo...

How to best server >10,000 iPhone clients from server (not web server)

I'm trying to build a server that will handle many concurrent connections to iPhone clients without multi-threading. I will be sending messages to all clients approximately every 10-30 seconds, but most messages will be identical or very similar and easy to sort. Given the setup of high-concurrency but low need for data sorting, I am t...

How would node.js stack up vs jetty for an etherpad-like application?

I noticed that etherpad, when it was alive ( and living clones of it ) used Jetty. I'm considering writing a similar program but I want to use node.js instead. Could anyone offer some insight into the pros and cons of Jetty/node.js performance-wise? ...

IDE for ECMAScript-262 with in IDE execution / debugging for node.js/V8

I currently use Eclipse as my IDE for other languages and I'm rather used to not having to leave the IDE for anything - however I'm really struggling to find the same or a similar setup for pure ECMAScript-262. To clarify, I am not looking for DOM support, jquery, HTML or anything like that, preferably just an IDE with ECMAScript-262 su...

What's an event-loop and how is it different than using other models?

I have been looking into Node.JS and all the documentation and blogs talk about how it uses an event-loop rather than a per-request model. I am having some confusion understanding the difference. I feel like I am 80% there understanding it but not fully getting it yet. ...

Node.js run script

Hi all, I have Apache httpd server and node.js. I need to emulate real JSON data which changes every time. I found, that I can run node.js as server in standalone mode like this: var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).list...

NodeJS won't return data to jQuery.getJSON

I've set up NodeJS and it's returning data when I browse to the URL: http://184.106.206.235 However, when I try to call that URL using $.getJSON, the callback shows "null" for the "data" variable and "success" for the "textStatus" variable. I imagine this could be a cross-domain thing, but I'm surprised that the textStatus says "succe...