[nodejs] linking node.js with libwrap

2012-11-04 Thread dhruvbird
Hello,

Has anyone linked the node.js executable against libwrap so that node.js 
based servers can make use of the hosts.allow and hosts.deny files? As I 
understand, libwrap transparently allows/denies TCP connections based on 
these parameters. Please let me know if my understanding is correct and if 
anyone has been able to get the two to work correctly together.

Regards,
-Dhruv.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] linking node.js with libwrap

2012-11-04 Thread dhruvbird


On Sunday, November 4, 2012 5:19:40 PM UTC-5, Ben Noordhuis wrote:
>
> On Sun, Nov 4, 2012 at 10:24 PM, dhruvbird > 
> wrote: 
> > Hello, 
> > 
> > Has anyone linked the node.js executable against libwrap so that node.js 
> > based servers can make use of the hosts.allow and hosts.deny files? As I 
> > understand, libwrap transparently allows/denies TCP connections based on 
> > these parameters. Please let me know if my understanding is correct and 
> if 
> > anyone has been able to get the two to work correctly together. 
> > 
> > Regards, 
> > -Dhruv. 
>
> Not transparently.  libwrap is a collection of functions that, among 
> other things, lets you parse hosts.* entries.  You still need to call 
> those functions though, it doesn't do any LD_PRELOAD magic or anything 
>

Ah! I was under the impression that LD_PRELOAD (or some such thing would be 
needed and it world work magically). Thanks for clarifying!
 

> (which probably wouldn't work anyway - node.js often makes system 
> calls directly instead of going through the libc wrappers.) 
>

Based on this, I took a look at the tcp-wrappers code and it seems that 
they use sync-file-i/o routines to read the hosts.* files. Do you think 
it's a good idea to use this on a running server or maybe emulate the 
matching based on a pure js implementation (assuming that the format of 
hosts.* is simple enough to parse out).

Regards,
-Dhruv.


 

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: ANN: ssh2 module

2012-11-11 Thread dhruvbird
Really interesting - and useful!

Curious to know why you need both pub & priv key instead of just the 
priv-key.

On Sunday, November 11, 2012 6:00:19 PM UTC-5, mscdex wrote:
>
> Hello all! 
>
> I'm announcing the first version of my ssh2 module, now available on 
> npm. 
>
> ssh2 aims to be a complete SSH2 client written in pure JavaScript that 
> implements the SSH2 protocol (it does not shell out to a command-line 
> ssh client). 
>
> Currently it can execute one-off commands and start interactive shell 
> sessions. There are still several things to be implemented and 
> tweaked, but I think it's at least in a fairly usable and stable state 
> now. 
>
> Feel free to give it a whirl and report any bugs you may come across. 
>
>
> https://github.com/mscdex/ssh2 (`npm install ssh2`) 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: find path of module require()ing

2012-11-21 Thread dhruvbird
Looks you want separate behaviour for every module require()ing you. Why 
not force every caller to instantiate an object of your custom class type, 
passing in a directory location? This has the added side effect of allowing 
a single module to instantiate multiple objects with potentially different 
arguments (something you might need later - it at least smells like it).

On Saturday, November 10, 2012 9:02:50 AM UTC-5, boden wrote:
>
> hi all,
> trying to find the proper way to determine the path of the module 
> requiring my module given the following requirements:
>
> * must be strict mode complaint
> * cannot depend on node arguments (i.e. process.argv)
> * must work when being required from different modules in the same 
> execution (i.e. my module is already cached)
>
> i ended up patching Module._load() to capture the request and then 
> wrapping it in a closure like shown here: 
> https://github.com/bodenr/expose/blob/master/index.js
>
> however this doesn't feel right -- i must be missing something.
>
> thx in advanced
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: How to keep node running without using Forever?

2012-11-27 Thread dhruvbird
I use http://cr.yp.to/daemontools.html

On Tuesday, November 27, 2012 12:04:38 AM UTC-5, Ket wrote:
>
> Hi,
>
> I feel that I don't like Forever much to keep my app restarted when it 
> stopped.
>
> Is there any other methods around to replace Forever.
>
> Thanks
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] ReadableStream from Buffer

2012-12-12 Thread dhruvbird
Hello,

Is there a module that creates a ReadableStream given a Buffer, or 
something like if I write to the stream, it emits the 'data' event every 
time someone writes to it.

I found 2 modules, both of which seem unrelated:

https://github.com/dodo/node-bufferstream
https://github.com/bnoordhuis/node-buffertools

Regards,
-Dhruv.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: TCP problem with node JS

2013-01-05 Thread dhruvbird
Hello!

When you establish a TCP connection, the data from the server to the client 
can go over the same socket without any problem if your nat/firewall has 
been configured properly.

If you still want to *force* a source port, you need to modify the client 
code in each of the devices to bind(2) the client socket to the port number 
you wish to use for that device.



On Saturday, January 5, 2013 6:28:24 AM UTC-5, benric...@googlemail.com 
wrote:
>
> Hey guys I have a problem with node and I hope you can help me.
>
> So the problem is that i have 9 network devices that are all listening on 
> the same port lets call it X these device all connect to the node JS server 
> and sending strings to the server. Now my problem is that between the 9 
> devices and the nodeserver is a router that shall map the connections with 
> different ports. I dont know much router and networking but what i know is 
> that the router maps 9 different ports to X our port that the devices are 
> using. Now i need node to write over the tcp protocoll via this matched 
> ports to communicate with the devices. How can i do it. When i have these 9 
> clients connected to my server they all have different remotePorts and 
> furthermore not the ones i would like them to have. 
>
> Is there any possibility to change the ports or to define them? Because I 
> am not allowed to make all ports accessable.
>
> Heres my sample code for a little server that connects n clients:
>
> function server(port){
> this.port = port;
>  this.clients = new Array();
> this.web;
> }
>
> server.prototype.listen = function(){
> this.connection = require('net').createServer();
> this.connection.listen(this.port, (function(){
> console.log('server listening on ' + this.port);
> }).bind(this));
>   return this.connection.on('connection', this.addClient.bind(this));
> };
>
> server.prototype.addClient = function(socket){
> this.clients.push(new client(socket, this));
> };
>
> function client(socket, server){
> this.socket = socket;
> this.server = server;
>  this.ip = socket.remoteAddress;
> this.port = socket.remotePort;
>  this.socket.on('connect', (function(){
> console.log('client:\nremoteAddress: ' + this.ip + '\nremotePort: ' + 
> this.port);
> }).bind(this));
> }
>
> tcp = new server();
> tcp.listen();
>
>
>
> Here is also a small sketch that i made:
>
>
> 
> I hope this helps
>
> And Thank you
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Problem computing the correct md5sum

2013-01-17 Thread dhruvbird
https://duckduckgo.com/?q=md5+%D0%92%D0%B5%D0%BB%D0%B8%D1%85%D0%BE%D0%B2%2C_%D0%95%D0%B2%D0%B3%D0%B5%D0%BD%D0%B8%D0%B9_%D0%9F%D0%B0%D0%B2%D0%BB%D0%BE%D0%B2%D0%B8%D1%87.jpeg

shows: 2d20149202635b06b67af28545739192

but:
x='Велихов,_Евгений_Павлович.jpeg'
c = require('crypto')
md5 = c.createHash('md5')
md5.update(x)
md5.digest('hex')

shows: 2fb2004e85d734547647e45a72863d13

Even wikipedia agrees with the hash computed by duckduckgo.
http://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/%D0%92%D0%B5%D0%BB%D0%B8%D1%85%D0%BE%D0%B2,_%D0%95%D0%B2%D0%B3%D0%B5%D0%BD%D0%B8%D0%B9_%D0%9F%D0%B0%D0%B2%D0%BB%D0%BE%D0%B2%D0%B8%D1%87.jpeg/240px-%D0%92%D0%B5%D0%BB%D0%B8%D1%85%D0%BE%D0%B2,_%D0%95%D0%B2%D0%B3%D0%B5%D0%BD%D0%B8%D0%B9_%D0%9F%D0%B0%D0%B2%D0%BB%D0%BE%D0%B2%D0%B8%D1%87.jpeg

What am I doing wrong?

Regards,
-Dhruv.






-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Problem computing the correct md5sum

2013-01-17 Thread dhruvbird
ah! thanks! That makes sense.

I tried changing: md5.update(x)
to: md5.update(x, 'utf8')

and I get the right answer.

I (wrongly) assumed the encoding to be default utf8 since that's what most 
functions in the 'fs' module have as the default.

Thanks!
-Dhruv.




On Thursday, January 17, 2013 3:00:03 PM UTC+5:30, mscdex wrote:
>
> On Jan 17, 4:10 am, dhruvbird  wrote: 
> > but: 
> > x='Велихов,_Евгений_Павлович.jpeg' 
> > c = require('crypto') 
> > md5 = c.createHash('md5') 
> > md5.update(x) 
> > md5.digest('hex') 
> > 
> > shows: 2fb2004e85d734547647e45a72863d13 
>
> It's a character encoding problem when you're pasting the string as- 
> is. If you use the raw bytes, you will get the right answer: 
>
> crypto.createHash('md5').update(new 
> Buffer([0xD0,0x92,0xD0,0xB5,0xD0,0xBB,0xD0,0xB8,0xD1,0x85,0xD0,0xBE, 
> 0xD0,0xB2,0x2C,0x5F,0xD0,0x95,0xD0,0xB2,0xD0,0xB3,0xD0,0xB5,0xD0,0xBD, 
> 0xD0,0xB8,0xD0,0xB9,0x5F,0xD0,0x9F,0xD0,0xB0,0xD0,0xB2,0xD0,0xBB, 
> 0xD0,0xBE,0xD0,0xB2,0xD0,0xB8,0xD1,0x87,0x2E,0x6A, 
> 0x70,0x65,0x67])).digest('hex'); 
>
> // in a REPL this correctly displays: 
> '2d20149202635b06b67af28545739192' 
>
> You can use a module like iconv/iconv-lite to convert between 
> encodings. 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] TLS issues with 0.10.2

2013-04-11 Thread dhruvbird
So I am trying to do xmpp with jabber.org using node-xmpp-bosh, 
and https://github.com/dhruvbird/node-xmpp-bosh/tree/fix-issue-66 (careful, 
not master branch) works perfectly with 0.8.11, but there is an error at 
the TLS handshake stage (it just hangs and refuses to move ahead) when 
connecting to jabber.org's XMPP server with 0.10.2.

Both versions works if I just try to authenticate with and account on 
gmail.com instead of jabber.org.

Am I doing something wrong, or has TLS changed massively?


-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] TLS issues with 0.10.2

2013-04-12 Thread dhruvbird
@Ben Sorry, no luck. Fails with both 10.3 and 10.4, but works with 8.11.

On Friday, April 12, 2013 12:40:42 AM UTC-7, Ben Noordhuis wrote:

> On Fri, Apr 12, 2013 at 3:48 AM, dhruvbird > 
> wrote: 
> > So I am trying to do xmpp with jabber.org using node-xmpp-bosh, and 
> > https://github.com/dhruvbird/node-xmpp-bosh/tree/fix-issue-66 (careful, 
> not 
> > master branch) works perfectly with 0.8.11, but there is an error at the 
> TLS 
> > handshake stage (it just hangs and refuses to move ahead) when 
> connecting to 
> > jabber.org's XMPP server with 0.10.2. 
> > 
> > Both versions works if I just try to authenticate with and account on 
> > gmail.com instead of jabber.org. 
> > 
> > Am I doing something wrong, or has TLS changed massively? 
>
> Upgrade.  Several crypto and tls bugs have been fixed in v0.10.3 and 
> v0.10.4. 
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] TLS issues with 0.10.2

2013-04-13 Thread dhruvbird
@Ben sorry - I was relying on undocumented behaviour of the socket's 
emitter part, and that bit me.
Was removing attached handlers in the _events array, but I guess some 
handlers are required by the socket object to function correctly now.

On Friday, April 12, 2013 1:47:42 PM UTC-7, Ben Noordhuis wrote:

> On Fri, Apr 12, 2013 at 9:59 PM, dhruvbird > 
> wrote: 
> > @Ben Sorry, no luck. Fails with both 10.3 and 10.4, but works with 8.11. 
>
> Okay, can you open an issue and include a test case?  One with no 
> dependencies on third-party modules, please. 
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] Re: path.exists: bug?

2012-06-04 Thread dhruvbird
Hello,

I think Massimo has a point here. If "/myfile" is a regular file, then
pathname resolution to "/myfile/." should fails and exists should imho
return false. Only in the case that "/myfile" is a directory should
the call return true.

Regards,
-Dhruv.

On Jun 1, 12:00 pm, Mark Hahn  wrote:
> You want `existsSync` to tell you if a path is a directory or a file. But
>  `existsSync` doesn't do that.  You would need to make that a feature
> request.
>
>
>
>
>
>
>
> On Fri, Jun 1, 2012 at 11:51 AM, Massimo Melina  wrote:
> > clear enough, thank you!
> > i consider it an unwanted side-effect of the normalization.
>
> > --
> > Job Board:http://jobs.nodejs.org/
> > Posting guidelines:
> >https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to nodejs@googlegroups.com
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Npm for installing daemons/services on premise (?)

2012-06-04 Thread dhruvbird
I personally feel it's a pretty nifty way to do things (modulo the use
of -g).

On Jun 4, 3:57 pm, José F. Romaniello  wrote:
> Hi list, I was thinking today if npm is the right tool to "deploy" or
> install my application in servers or vms i own.
> Doing:
>
> npm install git://myprivategit-repo -g
>
> From the vm and then some scripts to "daemonize" it. I am currently
> deploying to windows, and converting it to a windows service(no iisnode).
> But i think some of the thoughts i have so far are also valide for nix:
>
> -is this a bad practice?
>
> Cons:
> -the other thing doesnt feel right is that global packages ends in a folder
> inside the user home. And this is not usually the standard place to put an
> application.
> -i have to log to the server to update! Maybe i can put another thing
> listening to updates/ and then do npm update xx
>
> Pros:
> -super easy to set up
>
> The other scernario o have explored is to have the folder as a git end
> point (and a post receive hook) and pushing to that remote whenever i want
> to update. This is hard to set up this in windows at least.. But seems
> better in the long run, as the vms and nodes grow.
>
> Also I saw Isaacs fleet, looks very cool but havent tried yet.
>
> Thoughts?
>
> Thanks in advance!

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: path.exists: bug?

2012-06-05 Thread dhruvbird
Phew! That's a relief!

On Jun 4, 9:15 pm, Isaac Schlueter  wrote:
> That's already how it works, though.
>
> $ mkdir a
> $ touch x
> $ node> fs.existsSync('x/.')
> false
> > fs.existsSync('a/.')
>
> true
>
> In 0.6.18:
>
> > path.existsSync('x/.')
> false
> > path.existsSync('a/.')
>
> true
>
>
>
>
>
>
>
> On Mon, Jun 4, 2012 at 8:54 PM, dhruvbird  wrote:
> > Hello,
>
> > I think Massimo has a point here. If "/myfile" is a regular file, then
> > pathname resolution to "/myfile/." should fails and exists should imho
> > return false. Only in the case that "/myfile" is a directory should
> > the call return true.
>
> > Regards,
> > -Dhruv.
>
> > On Jun 1, 12:00 pm, Mark Hahn  wrote:
> >> You want `existsSync` to tell you if a path is a directory or a file. But
> >>  `existsSync` doesn't do that.  You would need to make that a feature
> >> request.
>
> >> On Fri, Jun 1, 2012 at 11:51 AM, Massimo Melina  wrote:
> >> > clear enough, thank you!
> >> > i consider it an unwanted side-effect of the normalization.
>
> >> > --
> >> > Job Board:http://jobs.nodejs.org/
> >> > Posting guidelines:
> >> >https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> >> > You received this message because you are subscribed to the Google
> >> > Groups "nodejs" group.
> >> > To post to this group, send email to nodejs@googlegroups.com
> >> > To unsubscribe from this group, send email to
> >> > nodejs+unsubscr...@googlegroups.com
> >> > For more options, visit this group at
> >> >http://groups.google.com/group/nodejs?hl=en?hl=en
>
> > --
> > Job Board:http://jobs.nodejs.org/
> > Posting 
> > guidelines:https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to nodejs@googlegroups.com
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: node.js fuse bindings?

2012-06-07 Thread dhruvbird
This would be good. I do remember some early stuff from Isaac.

On Jun 7, 4:42 pm, Marak Squires  wrote:
> Is anyone working on fuse bindings for node / has working fuse bindings
> yet? see:http://fuse.sourceforge.net/
>
> I know Isaac started to mess around 
> withhttps://github.com/isaacs/node-fuse/tree/dev, but he never finished and
> that code is now out-dated due to the libuv switch.
>
> Really need this for some upcoming stuff...
>
> --
> --
> Marak Squires
> Co-founder and Chief Evangelist
> Nodejitsu, Inc.
> marak.squi...@gmail.com

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: C10K Websocket Test

2012-06-17 Thread dhruvbird
+1 IIRC someone mentioned that ws is more performant.

On Saturday, June 16, 2012 2:14:11 PM UTC-7, Weltschmerz wrote:
>
> Still hasn't tested my version using *ws* I believe.
>
> On Saturday, June 16, 2012 3:42:30 PM UTC-5, ajlopez wrote:
>>
>> FYI,  I just received this link from an Erlang email list:
>>
>> https://github.com/ericmoritz/wsdemo/blob/results-v1/results.md 
>> Both the Python gevent/ws4py implementation and the Node.js websocket 
>> implementation failed hard with around half of the connections hitting the 
>> 2 second TCP connection timeout. 
>>
>>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: cluster API is amazing

2012-06-18 Thread dhruvbird
redis-lock looks interesting.

One line stood out though: "Since it's asynchronous, different functions 
could be holding different locks simultaneously. This is awesome!"

This is both good and bad. The good & bad part is that it's really easy to 
deadlock without knowing it since multiple functions may be circularly 
locked on a set of locks and other functions might be proceeding normally. 
Really hard to debug v/s a system that *actually* does get deadlocked.

On Monday, June 18, 2012 8:39:53 AM UTC-7, Rakesh Pai wrote:
>
> > My favoriate configuration is to use clustered workers with a redis 
> backend 
> > (redis and hiredis are also awesome modules) to share objects between 
> > workers (like sessions or other saved variables). 
>
> I can smell the concurrency problems with that. I had a similar issue 
> recently (not with cluster), and built this: 
> https://github.com/errorception/redis-lock 
>
> Feedback welcome, if you have any thoughts. Will be a great fit for 
> someone who already has redis in their stack. 
>
> Regards, 
> Rakesh Pai 
>
> On Mon, Jun 18, 2012 at 8:20 PM, Evan  wrote: 
> > Agree! I've been using it with actionHero, and it makes scaling out 
> quite 
> > simple. 
> > My favoriate configuration is to use clustered workers with a redis 
> backend 
> > (redis and hiredis are also awesome modules) to share objects between 
> > workers (like sessions or other saved variables). 
> > 
> > On Saturday, June 16, 2012 11:06:26 AM UTC-7, carter-thaxton wrote: 
> >> 
> >> Just a friendly note to say the new cluster API is truly amazing.  It 
> just 
> >> works! 
> >> It gave me ~6x speedup on one of my projects, with about 5 minutes of 
> >> development time. 
> >> 
> >> I've written similar integrations for TCP servers using fork() in C++ 
> >> before, and it's indeed a lot of work and quite subtle to get 
> everything 
> >> just right: 
> >> - Efficient piping of TCP streams to/from the child processes 
> >> - Graceful and automatic shutdown of the child processes 
> >> - Shared STDIO for straightforward console logging 
> >> - Signal handlers 
> >> - And lots more... 
> >> 
> >> Way to go!! 
> >> 
> > -- 
> > Job Board: http://jobs.nodejs.org/ 
> > Posting guidelines: 
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines 
> > You received this message because you are subscribed to the Google 
> > Groups "nodejs" group. 
> > To post to this group, send email to nodejs@googlegroups.com 
> > To unsubscribe from this group, send email to 
> > nodejs+unsubscr...@googlegroups.com 
> > For more options, visit this group at 
> > http://groups.google.com/group/nodejs?hl=en?hl=en 
>
>
>
> -- 
> Rakesh Pai 
> Mumbai, India. 
> http://rakeshpai.me/ 
> http://twitter.com/rakesh314 
> http://www.google.com/profiles/rakeshpai 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Sticky sessions using the new cluster API?

2012-06-18 Thread dhruvbird
Is it possible to have sticky sessions using the new cluster API? Some 
custom logic such as a cookie based solution? Something similar to nginx 
sticky module?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: [ANN] redis-lock: An implementation of locks using redis

2012-06-18 Thread dhruvbird
I wonder if anyone has tried to similarly use redis to do IPC between 
different node processes.

On Monday, June 18, 2012 2:38:42 PM UTC-7, Rakesh Pai wrote:
>
> I put this up on github a couple of days ago: 
> https://github.com/errorception/redis-lock 
>
> It's an implementation of a locking primitive using redis. It's great 
> for when you want to ensure that you don't run into concurrency issues 
> when using the node event loop heavily, or with multiple instances of 
> node. It doesn't block the event loop at all, yet ensures that your 
> functions execute in order (across processes), to ensure integrity. 
> it's kinda niche, but when you need it you need it badly. I've been 
> using this myself on http://errorception.com kinda heavily, and it 
> seems to do the job very well. I've tried hard to keep the API real 
> simple - just one function call! Depends on Redis, because I wanted 
> the lock to be sitting out of the node process, so that multiple 
> (node) processes can find out about it. 
>
> Feedback welcome, of course. Let me know what you think. (My first 
> node thing on github! Also, my first github thing! :D ) 
>
> -- 
> Rakesh Pai 
> Mumbai, India. 
> http://rakeshpai.me/ 
> http://twitter.com/rakesh314 
> http://www.google.com/profiles/rakeshpai 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: [ANN] redis-lock: An implementation of locks using redis

2012-06-19 Thread dhruvbird
Great! Looking forward to seeing those bits!

On Tuesday, June 19, 2012 2:26:25 AM UTC-7, Rakesh Pai wrote:
>
> I am using redis pub/sub to talk between processes, and redis lists as 
> a queue, so there's some amount of IPC right there. I hope to release 
> those bits soon. Stream API #ftw! 
>
> On Tue, Jun 19, 2012 at 10:06 AM, dhruvbird  wrote: 
> > I wonder if anyone has tried to similarly use redis to do IPC between 
> > different node processes. 
> > 
> > 
> > On Monday, June 18, 2012 2:38:42 PM UTC-7, Rakesh Pai wrote: 
> >> 
> >> I put this up on github a couple of days ago: 
> >> https://github.com/errorception/redis-lock 
> >> 
> >> It's an implementation of a locking primitive using redis. It's great 
> >> for when you want to ensure that you don't run into concurrency issues 
> >> when using the node event loop heavily, or with multiple instances of 
> >> node. It doesn't block the event loop at all, yet ensures that your 
> >> functions execute in order (across processes), to ensure integrity. 
> >> it's kinda niche, but when you need it you need it badly. I've been 
> >> using this myself on http://errorception.com kinda heavily, and it 
> >> seems to do the job very well. I've tried hard to keep the API real 
> >> simple - just one function call! Depends on Redis, because I wanted 
> >> the lock to be sitting out of the node process, so that multiple 
> >> (node) processes can find out about it. 
> >> 
> >> Feedback welcome, of course. Let me know what you think. (My first 
> >> node thing on github! Also, my first github thing! :D ) 
> >> 
> >> -- 
> >> Rakesh Pai 
> >> Mumbai, India. 
> >> http://rakeshpai.me/ 
> >> http://twitter.com/rakesh314 
> >> http://www.google.com/profiles/rakeshpai 
> > 
> > -- 
> > Job Board: http://jobs.nodejs.org/ 
> > Posting guidelines: 
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines 
> > You received this message because you are subscribed to the Google 
> > Groups "nodejs" group. 
> > To post to this group, send email to nodejs@googlegroups.com 
> > To unsubscribe from this group, send email to 
> > nodejs+unsubscr...@googlegroups.com 
> > For more options, visit this group at 
> > http://groups.google.com/group/nodejs?hl=en?hl=en 
>
>
>
> -- 
> Rakesh Pai 
> Mumbai, India. 
> http://rakeshpai.me/ 
> http://twitter.com/rakesh314 
> http://www.google.com/profiles/rakeshpai 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: [ANN] redis-lock: An implementation of locks using redis

2012-06-19 Thread dhruvbird
Great! Looking forward to seeing those bits!

On Tuesday, June 19, 2012 2:26:25 AM UTC-7, Rakesh Pai wrote:
>
> I am using redis pub/sub to talk between processes, and redis lists as 
> a queue, so there's some amount of IPC right there. I hope to release 
> those bits soon. Stream API #ftw! 
>
> On Tue, Jun 19, 2012 at 10:06 AM, dhruvbird wrote: 
> > I wonder if anyone has tried to similarly use redis to do IPC between 
> > different node processes. 
> > 
> > 
> > On Monday, June 18, 2012 2:38:42 PM UTC-7, Rakesh Pai wrote: 
> >> 
> >> I put this up on github a couple of days ago: 
> >> https://github.com/errorception/redis-lock 
> >> 
> >> It's an implementation of a locking primitive using redis. It's great 
> >> for when you want to ensure that you don't run into concurrency issues 
> >> when using the node event loop heavily, or with multiple instances of 
> >> node. It doesn't block the event loop at all, yet ensures that your 
> >> functions execute in order (across processes), to ensure integrity. 
> >> it's kinda niche, but when you need it you need it badly. I've been 
> >> using this myself on http://errorception.com kinda heavily, and it 
> >> seems to do the job very well. I've tried hard to keep the API real 
> >> simple - just one function call! Depends on Redis, because I wanted 
> >> the lock to be sitting out of the node process, so that multiple 
> >> (node) processes can find out about it. 
> >> 
> >> Feedback welcome, of course. Let me know what you think. (My first 
> >> node thing on github! Also, my first github thing! :D ) 
> >> 
> >> -- 
> >> Rakesh Pai 
> >> Mumbai, India. 
> >> http://rakeshpai.me/ 
> >> http://twitter.com/rakesh314 
> >> http://www.google.com/profiles/rakeshpai 
> > 
> > -- 
> > Job Board: http://jobs.nodejs.org/ 
> > Posting guidelines: 
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines 
> > You received this message because you are subscribed to the Google 
> > Groups "nodejs" group. 
> > To post to this group, send email to nodejs@googlegroups.com 
> > To unsubscribe from this group, send email to 
> > nodejs+unsubscr...@googlegroups.com 
> > For more options, visit this group at 
> > http://groups.google.com/group/nodejs?hl=en?hl=en 
>
>
>
> -- 
> Rakesh Pai 
> Mumbai, India. 
> http://rakeshpai.me/ 
> http://twitter.com/rakesh314 
> http://www.google.com/profiles/rakeshpai 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Sticky sessions using the new cluster API?

2012-06-24 Thread dhruvbird
Does the node clustering module provide hooks to achieve this (sticky 
sessions) or will I have to re-implement a bunch of things from scratch or 
copy-paste code?

On Friday, June 22, 2012 8:08:30 AM UTC-7, Bradley Meck wrote:
>
> There are a couple ways to do this.
>
> 1. Use a session store that is transactional and shared (redis etc.) and 
> store where a session should be forwarded to.
> 2. Use a hashing method that will consistently point to the same 
> location/worker for the same session (session could be ip/user/etc.), if 
> the wrong worker gets the connection, forward it to the original worker.
> 3. Use a master/slave setup using fork rather than cluster. Master gets 
> all the connections incoming on a machine and processes them before 
> forwarding them to the proper worker.
>
> Each method has its advantages.
>
> The alternative to this is to change an API to be state-less, which can be 
> hard if connections are using multiple protocols.
>
> On Monday, June 18, 2012 11:34:42 PM UTC-5, dhruvbird wrote:
>>
>> Is it possible to have sticky sessions using the new cluster API? Some 
>> custom logic such as a cookie based solution? Something similar to nginx 
>> sticky module?
>>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Sticky sessions using the new cluster API?

2012-06-25 Thread dhruvbird
Just saw the blog post introducing 0.8 and it seems that it's a conscious 
decision to leave sticky sessions out.

On Sunday, June 24, 2012 10:28:17 PM UTC-7, dhruvbird wrote:
>
> Does the node clustering module provide hooks to achieve this (sticky 
> sessions) or will I have to re-implement a bunch of things from scratch or 
> copy-paste code?
>
> On Friday, June 22, 2012 8:08:30 AM UTC-7, Bradley Meck wrote:
>>
>> There are a couple ways to do this.
>>
>> 1. Use a session store that is transactional and shared (redis etc.) and 
>> store where a session should be forwarded to.
>> 2. Use a hashing method that will consistently point to the same 
>> location/worker for the same session (session could be ip/user/etc.), if 
>> the wrong worker gets the connection, forward it to the original worker.
>> 3. Use a master/slave setup using fork rather than cluster. Master gets 
>> all the connections incoming on a machine and processes them before 
>> forwarding them to the proper worker.
>>
>> Each method has its advantages.
>>
>> The alternative to this is to change an API to be state-less, which can 
>> be hard if connections are using multiple protocols.
>>
>> On Monday, June 18, 2012 11:34:42 PM UTC-5, dhruvbird wrote:
>>>
>>> Is it possible to have sticky sessions using the new cluster API? Some 
>>> custom logic such as a cookie based solution? Something similar to nginx 
>>> sticky module?
>>>
>>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] nodeconf videos?

2012-07-03 Thread dhruvbird
This might not be the best place to post this, but will the nodeconf videos 
be available?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: nodeconf videos?

2012-07-04 Thread dhruvbird
:-( I was hoping to catch the node-mysql live coding - heard that it was a 
super-session! I hope they don't edit too much out of it.

On Wednesday, July 4, 2012 1:58:51 AM UTC-7, mscdex wrote:
>
> On Jul 4, 12:36 am, dhruvbird  wrote: 
> > This might not be the best place to post this, but will the nodeconf 
> videos 
> > be available? 
>
> If the last nodeconf is any indication, it'll probably be several 
> months until they're released. They do a lot of editing and whatnot to 
> get them all ready.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: XML DOM Libraries

2012-07-05 Thread dhruvbird
If you don't want fancy xpath-style query capabilities, might I suggest 
Astro's LTX: https://github.com/astro/ltx

On Thursday, July 5, 2012 3:17:24 PM UTC-7, Alan Gutierrez wrote:
>
> I'd like to parse XML and manipulate it on the server using W3C XML DOM, 
> so that 
> the code can be shared with the browser. 
>
> I've begun working with https://github.com/jindw/xmldom and I'm wondering 
> if 
> anyone has any opinions about the alternatives. I like this library 
> because it 
> is pure JavaScript, no dependencies on libxml2 or expat. 
>
> I've found https://github.com/tmpvar/jsdom, but I've found people having 
> problems using jsdom against XML. 
>
> https://groups.google.com/d/topic/jsdom/BuIAbklh5rA/discussion 
> https://groups.google.com/d/topic/jsdom/taHLnXcfsj4/discussion 
>
> jsdom seems very popular, however xmldom focuses more directly on what I 
> need to 
> accomplish, parse XML, not HTML, on the server side using W3 XML DOM. 
>
> -- 
> Alan Gutierrez - http://twitter.com/bigeasy - http://github.com/bigeasy 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: [ANN] node-xml-lite

2012-07-08 Thread dhruvbird
Why don't you make it compatible with the node-expat interface. It's sure 
to drive up adoption. Plus since this is pure javascript, it can be used 
from within a browser.

Also, how is this different from node-xml? - 
https://github.com/robrighter/node-xml

On Sunday, July 8, 2012 6:48:14 AM UTC-7, Henri Gourvest wrote:
>
> Hi, 
>
> I glad to present a new xml parser. 
> node-xml-lite is a pure javascript ANSI/Unicode SAX XML parser. 
> It only depends on iconv-lite that is only loaded if necessary. 
>
> https://github.com/hgourvest/node-xml-lite 
>
> -- 
> Henri Gourvest 
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: [ANN] node-xml-lite

2012-07-09 Thread dhruvbird


On Monday, July 9, 2012 2:52:31 AM UTC-7, Henri Gourvest wrote:
>
> Le 09/07/2012 07:38, dhruvbird a �crit : 
> > Also, how is this different from node-xml? - 
> > https://github.com/robrighter/node-xml 
>
> https://github.com/robrighter/node-xml/issues/18 
>
> node-xml have to read the whole file before decoding, it is a problem 
> that can't be solved. 
>

Interesting. I wasn't aware of this drawback - always thought that it had a 
streaming interface.



> node-xml-lite does not have this problem because it is an ANSI parser. 
>

What do you mean by "ANSI parser"?

 

> node-xml expect the xml file is utf8, so if it does not decode the 
> entire file, characters could be lost. 
>

That's okay, cause I guess it can be hacked to support a different encoding.
 

>
> I can see you are interested with xmpp, you could use node-xml-lite to 
> decode xmpp stream, but you will can't use node-xml because of this. 
>

True. I'm mostly interested because of xmpp stanza parsing. Again, having a 
node-expat compatible interface would be useful (imho).

Thanks!

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: [ANN] node-xml-lite

2012-07-10 Thread dhruvbird
Why not utf-8? I mean javascript string are unicode by default, so what's 
wrong with supporting international characters (this is probably very 
important).

On Tuesday, July 10, 2012 4:25:49 AM UTC-7, Henri Gourvest wrote:
>
> Le 10/07/12 09:54, Ryan Schmidt a �crit : 
> > A curious and highly personal definition to be sure. 
>
> what name should I use instead ? 
> ASCII ? 
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: [ANN] node-xml-lite

2012-07-10 Thread dhruvbird


On Tuesday, July 10, 2012 12:42:35 AM UTC-7, Henri Gourvest wrote:
>
>
> If you want to decode a xml document by chunks, you can cut a character, 
> if the partial chunk is decoded from UTF8 to Unicode to be parsed by 
> node-xml there will be a character lost, ouch! 
>

Sorry, but I didn't understand the paragraph above. Please could you 
elaborate what you mean by it?

Are you trying to say that if the Buffer() contains half a utf8 character, 
then the output stream will print just half the character? IIRC, utf8 is a 
self synchronizing stream, so as long as you are checking each byte to be 
something that has the high-bit reset, you should be generally okay. Does 
anyone see any problem with this?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: node-xml-lite

2012-07-18 Thread dhruvbird
Is it possible to feed this parser an incomplete XML stream and then pass 
it the rest of the stream? Something like a sax parser? I'm asking since 
all the examples show that you are passing a complete xml document to the 
parser every time.

On Wednesday, July 18, 2012 12:24:30 PM UTC-7, Henri Gourvest wrote:
>
> Le 18/07/12 17:56, Angelo Chen a �crit : 
> > 
> > How to extract a element from a XML string? 
>
> non SAX functions return objects like this 
>
> { 
> name: "root", 
> attrib: {...} 
> childs: [...] 
> } 
>
>
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Introduction to libuv

2012-07-30 Thread dhruvbird
+1 for adding in the libuv repo.

On Saturday, July 28, 2012 1:35:49 PM UTC-7, Oleg Efimov (Sannis) wrote:
>
> I think it will be good to include this as part of libuv repository.
>
> пятница, 27 июля 2012 г., 22:15:27 UTC+4 пользователь Nikhil написал:
>>
>> Hi guys, 
>>
>> I have been working on a sort of libuv guide book - 'An introduction 
>> to libuv' for the past few days. 
>> You can view it at http://nikhilm.github.com/uvbook/ 
>>
>> Its only about half complete (lots of TODOs all over), but with the 
>> recent spate of libuv queries, 
>> I thought I would just put it out in the open so that people can read 
>> the parts that are done. I 
>> eventually want it to cover all the features libuv provides, but for 
>> now basic I/O, TCP networking 
>> and threads is almost complete. 
>>
>> At this point the book requires prior understanding of event loops, 
>> until I polish up the introduction. 
>> Feel free to fork and contribute or file issues with the book. Github: 
>> https://github.com/nikhilm/uvbook. 
>>
>> This is the first time I'm writing something of such scope, so all the 
>> feedback I can get is welcome. 
>>
>> Regards, 
>> Nikhil 
>>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Why `fs.exists` has signature `(exists)` instead of `(err, exists)` ?

2012-08-17 Thread dhruvbird


On Friday, August 17, 2012 6:49:14 PM UTC-7, Jimb Esser wrote:
>
> In actuality, fs.exists *only* has an err argument... or really a "not 
> err" argument.  "fs.exists" is just "not fs.stat".  If you want fs.exists 
> to have an error as the first argument, do "my_fs_exists = fs.stat", and 
> it'll have exactly the same results (though will be slightly faster).
>
> But, yeah, slightly awkwardly different signature, though the "err" 
> argument of an "exists" query is basically meaningless, and "exists" was 
> not originally part of the "fs" module, so it's understandable.
>

I don't think it's meaningless.
If the fs returns an I/O error, you can't say that the file doesn't exist.


-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Feature poll: Do you use the clientError event?

2012-08-31 Thread dhruvbird
4 - didn't know it existed.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Feature poll: Do you use the clientError event?

2012-08-31 Thread dhruvbird
So is this like a place where _every_ accepted connection's error is 
propagated (in case there is an error on the accepted connection)?

Also, what are the semantics? I mean does the error get propagated 
irrespective of the fact that it might be handled as an 'error' event on 
the specific 'req' (readablestream) object?


-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Looking for a good xml parser in stream mode

2012-08-31 Thread dhruvbird
imho, node-expat (by @astro) is one of the best things you can use - you 
require to compile stuff though.
https://github.com/astro/node-expat/

otherwise, you can try http://github.com/robrighter/node-xml


-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Feature poll: Do you use the clientError event?

2012-09-01 Thread dhruvbird
Plus, it would be interesting to know the motivation behind this use case 
and what scenario it was envisioned for. One thing that comes to mind is 
efficiency since every request will not have to have a handle to a 
function. However, apart from the most trivial of use-cases, do you think 
that passing a handle to the request (and/or) response objects would make 
this handler generally more useful?

On Friday, August 31, 2012 9:38:05 AM UTC-4, Ben Noordhuis wrote:
>
> On Fri, Aug 31, 2012 at 3:02 PM, dhruvbird > 
> wrote: 
> > So is this like a place where _every_ accepted connection's error is 
> > propagated (in case there is an error on the accepted connection)? 
> > 
> > Also, what are the semantics? I mean does the error get propagated 
> > irrespective of the fact that it might be handled as an 'error' event on 
> the 
> > specific 'req' (readablestream) object? 
>
> Yes and yes. 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: various failures on stable test suite

2012-09-01 Thread dhruvbird
Might (or might not) be related: https://github.com/joyent/node/issues/3910

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Anonymous functions garbage collection

2012-09-14 Thread dhruvbird
Hello Maxim,

The real reason jslint gives you a warning is if you were to use the loop 
variable "i" within the function in the closure, you would always get the 
value of i to be a.length (assuming that the function isn't evaluated 
synchronously and that you don't have another function declared within the 
first one).

The code as you have shown seems to be perfectly safe to use though.

I wouldn't worry too much about the performance unless you profile it and 
determine it to be a bottleneck.

Regards,
-Dhruv.

On Thursday, September 13, 2012 2:00:42 AM UTC-4, Maxim Kazantsev wrote:
>
> It is a pretty typical approach to use an anonymous function for 
> asynchronous calls from inside a loop:
>
> var a = getInitialData();
>> for (var i = 0, len = a.length; i < len; i++) {
>>   (function(el) {
>> /* do something non-blocking here */
>>   })(a[i]);
>> }
>
>
> JSLint doesn't like this code with "Don't make functions within a loop" 
> warning, and it is actually right since it really creates a new anonymous 
> function on every single loop iteration. An obvious solution is to declare 
> this function outside a loop, but it would make a code less readable. Even 
> if a declaration would just precede the loop: you see a call here, you see 
> a declaration somewhere else, and here you are, lost all your attention.
>
> My question is how bad this approach is for an overall performance? In 
> particular, how fast and efficient a garbage collection of anonymous 
> functions is? How much memory a typical anonymous function can consume and 
> how long it may exist in a memory?
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Crockford : Ynode : "I would fork node.js"

2012-09-16 Thread dhruvbird
I think his statements should be taken positively - and if anyone cares 
maybe ask him more details about what he expects to change and see if his 
concerns are valid in the short/long term. Considering he is far more 
experienced than the collective experience of everyone on this thread, he 
should be taken very seriously.

On Saturday, September 15, 2012 10:45:30 AM UTC-4, Jorge wrote:
>
> http://www.youtube.com/watch?v=8HzclYKz4yQ#t=22m30s 
>
> "I would fork nodejs. Nodejs is a great thing and I would bet the company 
> on it, but I would not bet the company on Joyent. I see Joyent doing some 
> stuff which is amateurish, maybe a little chidish, so I would fork it, and, 
> I would then give that back to the community, and it would be industrial 
> strength and secure and designed to operate a Yahoo scale and would make it 
> available for everybody for free" 
>
> -- 
> Jorge.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Node 0.8 breaks use of /dev/stdin in child processes

2012-09-20 Thread dhruvbird
Hello,

So, I'm still trying to understand the implications of this change. Suppose 
I spawn "cat" and write to the stdin of the spawned process, then will the 
"cat" process not be able to read it?

var cat = spawn('cat');
cat.stdin.write('Foo Bar');
cat.stdout.on('data', function(d) { console.log("Child Says:", String(d); 
});

Will this do what I expect it to?


On Wednesday, September 19, 2012 6:20:23 PM UTC-4, Ben Noordhuis wrote:
>
> On Wed, Sep 19, 2012 at 9:54 PM, David Glasser 
> > 
> wrote: 
> > See https://gist.github.com/3751746 for details. 
> > 
> > Basically, in Node 0.6, if you start a child_process with 
> > child_process.spawn, the pipe2 system call was used to create the 
> > pipes between parent and child. 
> > 
> > This was changed (I believe) in this commit by indutny: 
> > 
> https://github.com/joyent/libuv/commit/c0081f0e6675131721dbb5138fd398792a8c2163
>  
> > 
> > Now the socketpair call is used to create those fds. 
> > 
> > I'm not sure why that choice was made, but it has at least one bad 
> > effect: it breaks the ability to use "/dev/stdin" or "/proc/self/fd/0" 
> > on the child, at least on Linux. 
> > 
> > The gist shows a Node program that basically just spawns "cat 
> > /proc/self/fd/0", closes the pipe to the cat, and shows what the cat 
> > outputs. In 0.6.17 cat happily cats the empty stdin and exits 1. In 
> > 0.8.8 cat fails to open the /proc/self/fd/0. 
> > 
> > The C program in the gist shows that the difference really is just 
> > socketpair vs pipe2. If you run the version with pipe2 the open call 
> > succeeds. Comment out pipe2 and uncomment socketpair, and the open 
> > call fails. 
> > 
> > Was this behavior change intentional? 
>
> Yes. 
>
> > What benefits are created by switching from pipe2 to socketpair? 
>
> The ability to send file descriptors to the child process (which was 
> something you could do in v0.4 but not v0.6). 
>
> It's been brought up on the issue tracker a few times. A 
> straightforward workaround is to insert a pipe. E.g.: 
>
>   spawn('foo') 
>
> Becomes: 
>
>   spawn('/bin/sh', ['-c', 'cat | foo']) 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: diffie-hellman on with more than 2 parties involved..

2012-10-18 Thread dhruvbird
In theory, it could possibly work with k participants (the same key). 
However, the easiest thing to do to get it to work with existing libraries 
might be to compute k choose 2 keys; 1 between every pair of participants.

On Thursday, October 18, 2012 7:45:31 AM UTC-4, Antoine wrote:

> Hi, 
>
> Is it possible with the current crypto impl to compute a 
> Diffie-Hellman shared key among 3 participants? 
>
>
> Antoine 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Error in SSL connection nodejs v0.6.21

2013-05-29 Thread dhruvbird
Hello,

I'm seeing intermittent SSL errors with this exception being thrown:

events.js:48
throw arguments[1]; // Unhandled 'error' event
   ^
Error: 3072407248:error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 
alert internal error:s23_clnt.c:741:

at CleartextStream._puller (tls.js:501:24)
at CleartextStream._pull (tls.js:432:19)
at SecurePair.cycle (tls.js:727:20)
at EncryptedStream.write (tls.js:130:13)
at Socket.ondata (stream.js:38:26)
at Socket.emit (events.js:67:17)
at TCP.onread (net.js:372:14)


Very few other people seem to be seeing it though.
https://www.google.com/search?q=node.js%20_GET_SERVER_HELLO%3Atlsv1%20alert%20internal%20error%3As23_clnt.c%3A741

Using nodejs v0.6.21. Is this something that's been fixed in later versions?
Link to reported issue: 
https://github.com/dhruvbird/node-xmpp-bosh/issues/76

The reason that the OP is unable to use latest nodejs version is that ::: 
(ipv6 style 0.0.0.0) doesn't seem to be working for him, when that address 
is specified as the address to listen on (on the 0.10.x branch).

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Error in SSL connection nodejs v0.6.21

2013-05-29 Thread dhruvbird


On Wednesday, May 29, 2013 10:14:56 AM UTC-7, Ben Noordhuis wrote:
>
> On Wed, May 29, 2013 at 6:53 PM, dhruvbird > 
> wrote: 
> > Hello, 
> > 
> > I'm seeing intermittent SSL errors with this exception being thrown: 
> > 
> > events.js:48 
> > throw arguments[1]; // Unhandled 'error' event 
> >^ 
> > Error: 3072407248:error:14077438:SSL 
> routines:SSL23_GET_SERVER_HELLO:tlsv1 
> > alert internal error:s23_clnt.c:741: 
> > 
> > at CleartextStream._puller (tls.js:501:24) 
> > at CleartextStream._pull (tls.js:432:19) 
> > at SecurePair.cycle (tls.js:727:20) 
> > at EncryptedStream.write (tls.js:130:13) 
> > at Socket.ondata (stream.js:38:26) 
> > at Socket.emit (events.js:67:17) 
> > at TCP.onread (net.js:372:14) 
> > 
> > 
> > Very few other people seem to be seeing it though. 
> > 
> https://www.google.com/search?q=node.js%20_GET_SERVER_HELLO%3Atlsv1%20alert%20internal%20error%3As23_clnt.c%3A741
>  
> > 
> > Using nodejs v0.6.21. Is this something that's been fixed in later 
> versions? 
> > Link to reported issue: 
> > https://github.com/dhruvbird/node-xmpp-bosh/issues/76 
> > 
> > The reason that the OP is unable to use latest nodejs version is that 
> ::: 
> > (ipv6 style 0.0.0.0) doesn't seem to be working for him, when that 
> address 
> > is specified as the address to listen on (on the 0.10.x branch). 
>
> That's because it's '::' (two colons), ':::' means the 'any' address 
> followed by a port number. 
>

You're right. My bad. Here's the original post.

https://github.com/dhruvbird/node-xmpp-bosh/issues/75



> As to the TLS error, at the very least v0.10 should give you a more 
> descriptive error message. 
>

Will try to repro. if listening on :: works out. According to the issue 
above, the http server just froze.

 

>
> If it's a server, it's possible you're not setting the certificate and 
> key properly.  Before v0.10 that was allowed but you then ended up 
> with a server that couldn't accept connections. 
>

The TLS connection is a client connection.

So, I'm using this file 
https://github.com/dhruvbird/node-xmpp-bosh/blob/master/src/starttls.js to 
upgrade from a normal socket to a secure socket and am afraid that there 
might be a bug there. I couldn't any "standard library" method to do the 
same (similar to an HTTP upgrade). I haven't dug into the http client code 
to see if there are any parts of the std. lib. that do this already.

An unsure if this 
https://github.com/mattcg/starttls/commit/f2b50dc024df212d51bde1d14d1d3faae5d1eb49
 will 
fix the current bug, but will give it a shot as well.


-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] Re: Error in SSL connection nodejs v0.6.21

2013-05-29 Thread dhruvbird
@mscdex: I want to start tls negotiation on an already connected socket 
rather than an already created socket. Is that possible with the standard 
exposed API?
http://nodejs.org/api/tls.html#tls_tls_connect_options_callback seems to 
suggest otherwise.

On Wednesday, May 29, 2013 9:53:12 AM UTC-7, dhruvbird wrote:

> Hello,
>
> I'm seeing intermittent SSL errors with this exception being thrown:
>
> events.js:48
> throw arguments[1]; // Unhandled 'error' event
>^
> Error: 3072407248:error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 
> alert internal error:s23_clnt.c:741:
>
> at CleartextStream._puller (tls.js:501:24)
> at CleartextStream._pull (tls.js:432:19)
> at SecurePair.cycle (tls.js:727:20)
> at EncryptedStream.write (tls.js:130:13)
> at Socket.ondata (stream.js:38:26)
> at Socket.emit (events.js:67:17)
> at TCP.onread (net.js:372:14)
>
>
> Very few other people seem to be seeing it though.
>
> https://www.google.com/search?q=node.js%20_GET_SERVER_HELLO%3Atlsv1%20alert%20internal%20error%3As23_clnt.c%3A741
>
> Using nodejs v0.6.21. Is this something that's been fixed in later 
> versions?
> Link to reported issue: 
> https://github.com/dhruvbird/node-xmpp-bosh/issues/76
>
> The reason that the OP is unable to use latest nodejs version is that ::: 
> (ipv6 style 0.0.0.0) doesn't seem to be working for him, when that address 
> is specified as the address to listen on (on the 0.10.x branch).
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Error in SSL connection nodejs v0.6.21

2013-05-29 Thread dhruvbird
@Ben: Got an update.

node: ../src/node_crypto.cc:975: void 
node::crypto::Connection::ClearError(): Assertion 
`handle_->Get(String::New("error"))->BooleanValue() == false' failed.


On Wednesday, May 29, 2013 10:14:56 AM UTC-7, Ben Noordhuis wrote:
>
> On Wed, May 29, 2013 at 6:53 PM, dhruvbird > 
> wrote: 
> > Hello, 
> > 
> > I'm seeing intermittent SSL errors with this exception being thrown: 
> > 
> > events.js:48 
> > throw arguments[1]; // Unhandled 'error' event 
> >^ 
> > Error: 3072407248:error:14077438:SSL 
> routines:SSL23_GET_SERVER_HELLO:tlsv1 
> > alert internal error:s23_clnt.c:741: 
> > 
> > at CleartextStream._puller (tls.js:501:24) 
> > at CleartextStream._pull (tls.js:432:19) 
> > at SecurePair.cycle (tls.js:727:20) 
> > at EncryptedStream.write (tls.js:130:13) 
> > at Socket.ondata (stream.js:38:26) 
> > at Socket.emit (events.js:67:17) 
> > at TCP.onread (net.js:372:14) 
> > 
> > 
> > Very few other people seem to be seeing it though. 
> > 
> https://www.google.com/search?q=node.js%20_GET_SERVER_HELLO%3Atlsv1%20alert%20internal%20error%3As23_clnt.c%3A741
>  
> > 
> > Using nodejs v0.6.21. Is this something that's been fixed in later 
> versions? 
> > Link to reported issue: 
> > https://github.com/dhruvbird/node-xmpp-bosh/issues/76 
> > 
> > The reason that the OP is unable to use latest nodejs version is that 
> ::: 
> > (ipv6 style 0.0.0.0) doesn't seem to be working for him, when that 
> address 
> > is specified as the address to listen on (on the 0.10.x branch). 
>
> That's because it's '::' (two colons), ':::' means the 'any' address 
> followed by a port number. 
>
> As to the TLS error, at the very least v0.10 should give you a more 
> descriptive error message. 
>
> If it's a server, it's possible you're not setting the certificate and 
> key properly.  Before v0.10 that was allowed but you then ended up 
> with a server that couldn't accept connections. 
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] Re: Error in SSL connection nodejs v0.6.21

2013-05-30 Thread dhruvbird
@mscdex: Ah! I see what you mean now.


   - 
   
   socket: Establish secure connection on a given socket rather than 
   creating a new socket. If this option is specified, host and port are 
   ignored.
   
So, if the socket is passed, then is TLS negotiation is initiated on the 
existing socket?



On Wednesday, May 29, 2013 11:35:05 PM UTC-7, mscdex wrote:
>
> On May 30, 1:02 am, dhruvbird  wrote: 
> > @mscdex: I want to start tls negotiation on an already connected socket 
> > rather than an already created socket. Is that possible with the 
> standard 
> > exposed API?
> http://nodejs.org/api/tls.html#tls_tls_connect_options_callbackseems to 
> > suggest otherwise. 
>
> I'm not quite sure what you mean. The socket can be connected or not 
> when you pass it to tls.connect(). All you need is a reference to the 
> socket object. 
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] meaning of the semver ~

2013-05-30 Thread dhruvbird


On Thursday, May 30, 2013 12:52:47 PM UTC-7, Dominic wrote:
>
> without looking in the documentation or trying it in the repl 
>
> what do you expect to be the results of these tests on semver ranges? 
>
> A. semver.satisfies('~1.2.3', '1.2.4') 
>

True, because 1.2.3 seems to be approximately 1.2.4 


> B. semver.satisfies('~1.2', '1.3.0') 
>

False, since 1.3.0 is not approximately 1.2


> C. semver.satisfies('~1.2', '1.2.6') 
>

True.
 

>
> D. semver.satisfies('1.2', '1.3.0') 
>

True, since I assume that 1.3.0 is 1.2.x and more.
 

>
> E. semver.satisfies('1.2', '1.2.4') 
>

True again.

 

>
> please don't look at the documentation, the question is: 
>
> what do you think it means? 
>

~1.2.3 probably means a version around 1.2.3 with the rev. possibly 
different. I expect only revisions >= 3 to match though.


 

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Error in SSL connection nodejs v0.6.21

2013-05-31 Thread dhruvbird
Does the node build system include symbol and line# information in the 
default optimized build as well?
If not, what's the way to do that?

On Thursday, May 30, 2013 4:29:19 AM UTC-7, Ben Noordhuis wrote:

> On Thu, May 30, 2013 at 7:37 AM, dhruvbird > 
> wrote: 
> > @Ben: Got an update. 
> > 
> > node: ../src/node_crypto.cc:975: void 
> > node::crypto::Connection::ClearError(): Assertion 
> > `handle_->Get(String::New("error"))->BooleanValue() == false' failed. 
>
> If you have a simple test cases that reproduces that, please post it 
> in the issue tracker.  Failing that, a gdb backtrace might do (but 
> preferably from a debug build.) 
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] Re: Error in SSL connection nodejs v0.6.21

2013-05-31 Thread dhruvbird
@mscdex: Thanks for the info. Will try this out.

On Thursday, May 30, 2013 9:21:18 PM UTC-7, mscdex wrote:

> On May 30, 3:49 pm, mscdex  wrote: 
> > On May 30, 1:47 pm, dhruvbird  wrote: 
> > 
> > > So, if the socket is passed, then is TLS negotiation is initiated on 
> the 
> > > existing socket? 
> > 
> > Yes, it is negotiated on the socket you pass in and the callback is 
> > executed once the negotiation is successful. 
>
> Also remember that you should not write to the socket object once you 
> pass to tls.connect(). Once the callback is executed, you should 
> instead continue any/all writing to the object returned by 
> tls.connect(). 
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] Node.js EventEmitter off method

2013-06-08 Thread dhruvbird
I don't know if this has been discussed before, but jQuery has an "off" 
method that works like "removeListener". The node.js EventEmitter has an 
"on" and an "addListener" method, but no "off" method. Any good reason not 
to add it for symmetry?

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] Re: JS or node? require("http://scripthost/myModule.js");

2013-06-12 Thread dhruvbird
You could use https://github.com/dhruvbird/http-sync to emulate this 
behaviour.
However, as Isaac mentioned, you might want to be careful with it. It's 
super convenient though.

On Tuesday, June 11, 2013 12:49:43 PM UTC-7, nos...@hoodel.com wrote:
>
>
> I'm reading JavaScript on the Server Using Node.js and Express. Having 
> just read the chapter on modules, it seems overly restrictive to make 
> require() refer only to files. It seems to me that a hosted module server 
> could be really useful in some applications. Would this be a node.js issue 
> or confined to JavaScript?
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] Re: Fun little HTTP "bug"

2013-06-20 Thread dhruvbird
Which broken server are you using?

On Thursday, June 20, 2013 11:20:46 AM UTC-7, Matt Sergeant wrote:
>
> Just posting this here so other people might find it...
>
> If you're doing HTTP requests in Node, and the remote server responds with 
> a Content-Length header, but then proceeds to send you content longer than 
> that, your Node request will emit an error with code HPE_INVALID_CONSTANT. 
> It's confusing because Node also emits this if the response doesn't start 
> with "HTTP". Might be useful to make it two errors.
>
> It's really hard to fix, and I did so with an ugly hack, which I won't 
> document here because it's frickin ugly and mixed in with other fixes to 
> badly formed http responses that I have to deal with.
>
> But hopefully this at least will serve as a search reference for when 
> people are super confused by this error message.
>
> Matt.
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] Re: [Announcement] Norch- a search engine for node.js

2013-07-06 Thread dhruvbird
Great stuff!!
Do you have an online hosted demo for this?

On Friday, July 5, 2013 7:12:24 AM UTC-7, Fergus McDowall wrote:
>
>
> http://blog.comperiosearch.com/blog/2013/07/05/norch-a-search-engine-for-node-js/
>
> Norch (http://fergiemcdowall.github.io/norch/) is a search engine written 
> for Node.js. Norch uses the Node search-index module which is in turn 
> written using the super fast levelDB library that Google open-sourced in 
> 2011.
>
> The aim of Norch is to make a simple, fast search server, that requires 
> minimal configuration to set up. Norch sacrifices complex functionality for 
> a limited robust feature set, that can be used to set up a free test search 
> engine for most enterprise scenarios.
>
> Currently Norch features
>
> Full text search
> Stopword removal
> Faceting
> Filtering
> Relevance weighting (tf-idf)
> Field weighting
> Paging (offset and resultset length)
>  
> Norch can index any data that is marked up in the appropriate JSON format
>  
> Download the first release of Norch (0.2.1) here (
> https://github.com/fergiemcdowall/norch/releases)
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Downside to not wrapping sync callbacks in nextTick()?

2013-09-01 Thread dhruvbird
@Bryan: Be careful when using the EventEmitter like pattern because:

var e = new ObjectDerivingFromEventEmitter()
e.makeRequest(request_parameters);
e.on('error', function() { });

Now, if makeRequest() were to emit the 'error' event synchronously, the 
client code will not be able to catch it.

Even worse is when e.makeRequest() returns a response object and the error 
is emitted on that response object. There is no way to catch this 'error' 
event but to raise it in nextTick().



On Tuesday, August 20, 2013 11:12:35 AM UTC-7, Bryan Donovan wrote:
>
> Thanks Scott.
>
> That's basically what I had gathered from googling around.  It seems to me 
> like it's not necessary to wrap in nextTick for most cases then.
>
>
> On Aug 20, 2013, at 10:58 AM, Scott González 
> > 
> wrote:
>
> The potential issue is if the person consuming your API expects the 
> callback to always be async:
>
> // kick off the async process as early as possible
> doAsync( cb );
> // do some slightly high cost prep work before the callback is invoked
> prepareStateForCallbackWhileWaiting();
>
> Doing the prep work after the async call allows you to reduce the amount 
> of time needed between the start of this tick and the tick when the 
> callback is actually invoked. Interestingly, the reason some people don't 
> like forcing async is for performance gains when the operation can be sync.
>
> You're going to get lots of arguments on both sides.
>
>
>
> On Tue, Aug 20, 2013 at 1:47 PM, Bryan Donovan 
> > wrote:
>
>> I have been writing node.js client code for a couple of years now, and 
>> have authored a couple open source libraries, but somehow I missed the memo 
>> telling me that I'm supposed to wrap 'synchrounous' callbacks in 
>> process.nextTick().  I kind-of understand why that is a best-practice, but 
>> what I don't understand is what the drawback is if you don't do it.
>>
>> For example, I write code like this all the time, and have never had a 
>> single problem with it:
>>
>> function getSomething(args, cb) {
>> if (!args) { return cb(new Error('args required')); }
>> if (!args.id) { return cb(new Error('args.id required')); }
>>
>> SomeDatabase.get({id: args.id}, cb);
>> }
>>
>> What are the potential issues with not wrapping those arg checks in 
>> process.nextTick()?
>>
>>
>> Thanks, 
>>
>> Bryan
>>
>> -- 
>> -- 
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: 
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nod...@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+un...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "nodejs" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to nodejs+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
> -- 
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com 
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com 
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>  
> --- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "nodejs" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/nodejs/0TmVfX9z1R0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> nodejs+un...@googlegroups.com .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[nodejs] Re: Passing another open file (descriptor, stream,socket) to a unix program

2013-10-13 Thread dhruvbird
Have you tried using 
http://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options
 and 
the child.send(message, [sendHandle]) API?

On Friday, October 11, 2013 8:29:43 AM UTC-7, Mike Aubury wrote:
>
> Ok - this might be a little "out there" - but I'm using "spawn" to start a 
> process - with the stdin, stdout, stderr read/written by my node app..
>
>
> child = spawn("Sometime",[ ]);
>
> ...
> child.stderr.on('data',function(d) {
> console.log("STDERR>>"+d);
> });
>
> etc etc..
>
> And that all works great :)
>
>
> Now - what I could ideally do with with *another* stream to communicate 
> between my unix program and the node.js (basically - I want to get the 
> stdout and stderr - but also have a third channel just for communicating to 
> the node.js stuff for various control operations ).
>
> Any ideas how I can do this ?
> I was thinking of named pipes etc - and passing in a filename, or setting 
> some environment variable - but this seems overkill - all I need is another 
> stream I can "fprintf" to from my C program !
>
>
> Any thoughts or ideas would be much appreciated!
>
>
>
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[nodejs] Automatically populate dependencies based on node_modules folder contents?

2012-02-21 Thread dhruvbird
Hello,

While developing stuff, I tend to "npm install packageX" for packages
I want and then I need to manually add it to my package.json. Is there
a way to make npm do this for me automatically?

Regards,
-Dhruv.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Automatically populate dependencies based on node_modules folder contents?

2012-02-22 Thread dhruvbird
Wow! Thanks a ton :)
Does -S work with update/upgrade as well (I mean if I update the
packages?)

Regards,
-Dhruv.

On Feb 21, 11:02 pm, Thomas Blobaum  wrote:
> yes.
>
> npm install package --save
> or npm install package -S
>
> http://npmjs.org/doc/
>
> Thomas Blobaumhttps://github.com/tblobaum
>
>
>
>
>
>
>
> On Tue, Feb 21, 2012 at 8:40 AM, dhruvbird  wrote:
> > Hello,
>
> > While developing stuff, I tend to "npm install packageX" for packages
> > I want and then I need to manually add it to my package.json. Is there
> > a way to make npm do this for me automatically?
>
> > Regards,
> > -Dhruv.
>
> > --
> > Job Board:http://jobs.nodejs.org/
> > Posting guidelines:
> >https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to nodejs@googlegroups.com
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Automatically populate dependencies based on node_modules folder contents?

2012-02-26 Thread dhruvbird

On Feb 26, 11:19 am, Isaac Schlueter  wrote:
> -S|--save is only respected by `npm install`, not by any other
> command, and it's not retro-active.  (Ie, it only works when you
> install the dep, not any time later.)
>
> It'd be nice if `npm init` could automatically walk through the things
> installed directly in node_modules, and suggest dependencies, but
> there's nothing like this now.

I think it's "okay" to have just -S (it solves my problem for now),
but a retroactive version would be super cool!

I guess you can also have a module that parses your js code and
suggests deps. based on the require(XYZ) string, etc... but it seems
overkill.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: nginx inserting junk data into buffered response.write?

2012-03-04 Thread dhruvbird
I've had someone report weird crashes with latest nginx. Dunno if it
has something to do with this.
http://code.google.com/p/node-xmpp-bosh/issues/detail?id=41

Works perfect with older versions of nginx though.

Regards,
-Dhruv.


On Mar 4, 9:26 pm, Henry Todd  wrote:
> On 05/03/12 at 12:22am, Ben Noordhuis wrote:
>
>
>
> >That looks like chunk markers (the chunk size in hex) from a
> >Transfer-Encoding: chunked response.
>
> It certainly looks that way. The chunks themselves are clean (dumped to
> file and verified with dhex) and comparing `curl --head` on standalone
> and nginx shows that apart from the expected Server: header they are the
> same:
>
>    HTTP/1.1 200
>    Server: nginx/1.0.12
>    Date: Mon, 05 Mar 2012 02:02:38 GMT
>    Content-Type: text/xml; charset=UTF-8
>    Connection: keep-alive
>    etag: rM1jGkNUA9AzVj2iMQN9KWwLgcQ
>    last-modified: Mon, 05 Mar 2012 02:07:53 GMT
>    expires: Mon, 05 Mar 2012 02:08:03 GMT
>    cache-control: private, max-age=0
>    x-content-type-options: nosniff
>    x-xss-protection: 1; mode=block
>    transfer-encoding: chunked
>
> I'm guessing this is really more a question for the nginx list. I was
> just wondering if anyone here had seen this behaviour before.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Would this ngnix bug affect node?

2012-03-15 Thread dhruvbird
I am assuming we use a significant portion of the ngnix http parser.

http://nginx.org/download/patch.2012.memory.txt

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Would this ngnix bug affect node?

2012-03-16 Thread dhruvbird

On Mar 15, 9:32 am, Ben Noordhuis  wrote:
> On Thu, Mar 15, 2012 at 14:27, dhruvbird  wrote:
> > I am assuming we use a significant portion of the ngnix http parser.
>
> >http://nginx.org/download/patch.2012.memory.txt
>
> We don't[1]. They're both big state machines written in C, that's
> where the similarity ends.
>
> [1]https://github.com/joyent/http-parser

ah! Thanks for the clarification!

I saw this line in the code and thought they were the same: " Based on
src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev"

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Modest proposal to make async optional in Node.js

2012-04-02 Thread dhruvbird
I think that the sync API is useful (and I extensively used it) for
shell scripts mainly.

Especially the following API *should* (in my opinion) have sync
alternatives (maybe a separate module so that there is NO confusion
what-so-ever).

1. Filesystem (already exists)
2. SQL (sqlite/mysql/pg/etc...) - I don't think all have sync
alternatives
3. http (basic implementation: https://github.com/dhruvbird/http-sync
)
4. Basically [3] speaks about blocking network calls

IMHO, if you want to implement anything that isn't reactive to user
input (something like a batch process), then sync APIs are much
cleaner to work with. On the plus side, if you are invoking these API
many times (for example processing wikipedia pages for every day hit
counts), then the sync API would probably have a smaller constant
overhead per call.

Regards,
-Dhruv.


On Apr 2, 5:27 am, Michael Nisi  wrote:
> I think the Sync alternative functions in core should go entirely.
> They clutter APIs (and mentalities).
>
>
>
>
>
>
>
> On Mon, Apr 2, 2012 at 10:53 AM, Oliver Leics  wrote:
> > Asynchronicity in Node can not be made optional as it is (by design)
> > the default.
>
> > On Mon, Apr 2, 2012 at 4:20 AM, Olivier Lalonde  wrote:
> >> I believe there would be an easy way to change the status quo without
> >> impacting developers who chose to adhere to a strict async style. The
> >> solution I propose is simply a pattern for writing I/O APIs: every I/O call
> >> should be async unless no call back is supplied, in which case the I/O call
> >> should be sync and use return / throw statements instead of calling a
> >> callback.
>
> > Please, have a look at streamline.js
> >https://github.com/Sage/streamlinejs
>
> > It kind of reveres your proposed solution by giving every async
> > function the same callback that turns the async function into a sync
> > function (aka: you can write code that looks synchronous)
>
> > Short example:
>
> >  var s = fs.stat(path, _)
> >  console.log(s.size)
>
> > The underscore "_" is the callback you have to give to every async
> > function to turn it into a function that behaves like a synchronous
> > one.
>
> > I would really like to know if that might work for you.
>
> > --
> > Job Board:http://jobs.nodejs.org/
> > Posting 
> > guidelines:https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to nodejs@googlegroups.com
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: How to gzipSync?

2012-04-19 Thread dhruvbird
Hello,

You could (at least in theory) spawn a gzip process that writes to a
FIFO* (named pipe) and then use fs.readFileSync() to read that FIFO.
Your process should block till you have completed reading in the FIFO.
Create a wrapper function to do this an you have a blocking gzip()
routine!

* Might not work on windows.

Regards,
-Dhruv.

On Apr 18, 5:12 am, Axel Kittenberger  wrote:
> Is there some easy way to make yourself a zlib.gzipSync wrapper around
> the nodes default callback/pipe interface to zlib? (Without streamline
> or fibers)
>
> Its for the server startup sequence where it generates one hugh
> javascript file for the client side to download and it keeps it raw as
> well gzipped in memory. It does read the files with readSyncFile etc.
> So yes I want the node process to be halted until it is done. Its fine
> it takes 2 seconds, so please don't argue it could do this or that in
> parallel. I also do the other *Sync calls for startup. I just want to
> keep that simple please.
>
> - Axel

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Will vert.x pose a threat to node.js?

2012-05-09 Thread dhruvbird
Why not have a benchmark that doesn't read from the file, but instead
writes out the contents of a static string.

On May 9, 9:56 pm, Matt  wrote:
> No.
>
> Though I imagine Isaacs is wondering where the file read performance
> difference is. My gut feeling is that Java maybe uses mmap under the hood,
> or some other performance trick. It would be much more obvious if there
> were strace output. There's also other probable wins, like using a newer V8
> that optimises non-VM functions (see recent thread about threads-a-gogo
> being faster even with just one thread).
>
>
>
>
>
>
>
> On Wed, May 9, 2012 at 9:32 PM, Node42  wrote:
> > http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple...";>Benchmark
> > 
>
> > http://news.ycombinator.com/item?id=3948727";>Hacker News
> > Discussion
>
> > http://news.ycombinator.com/item?id=3927891";>Hacker News
> > Discussion 2
>
> > http://vertx.io/";>Vert.x
>
> > http://www.infoq.com/news/2012/05/vertx";>InforQ article
>
> > http://fbflex.wordpress.com/2012/05/02/running-vert-x-applications-on...";>Running
> > Vert.x Applications on Heroku
>
> > --
> > Job Board:http://jobs.nodejs.org/
> > Posting guidelines:
> >https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to nodejs@googlegroups.com
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Will vert.x pose a threat to node.js?

2012-05-10 Thread dhruvbird
I was wondering - how tightly coupled is node to v8 actually? I mean I
have heard that mozilla is making their runtime API compatible with
that of the v8 API, so is it possible to just plug it in instead of
v8? I remember seeing a project called SpiderNode doing so a while
ago.

Regards,
-Dhruv.

On May 10, 7:51 am, Erik Dubbelboer  wrote:
> They actually use Rhino  instead of
> V8.
>
>
>
>
>
>
>
> On Thursday, May 10, 2012 3:56:26 AM UTC+2, Matt Sergeant wrote:
>
> > No.
>
> > Though I imagine Isaacs is wondering where the file read performance
> > difference is. My gut feeling is that Java maybe uses mmap under the hood,
> > or some other performance trick. It would be much more obvious if there
> > were strace output. There's also other probable wins, like using a newer V8
> > that optimises non-VM functions (see recent thread about threads-a-gogo
> > being faster even with just one thread).
>
> > On Wed, May 9, 2012 at 9:32 PM, Node42  wrote:
>
> >> http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple...";>Benchmark
> >> 
>
> >> http://news.ycombinator.com/item?id=3948727";>Hacker News
> >> Discussion
>
> >> http://news.ycombinator.com/item?id=3927891";>Hacker News
> >> Discussion 2
>
> >> http://vertx.io/";>Vert.x
>
> >> http://www.infoq.com/news/2012/05/vertx";>InforQ article
>
> >> http://fbflex.wordpress.com/2012/05/02/running-vert-x-applications-on...";>Running
> >> Vert.x Applications on Heroku
>
> >> --
> >> Job Board:http://jobs.nodejs.org/
> >> Posting guidelines:
> >>https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> >> You received this message because you are subscribed to the Google
> >> Groups "nodejs" group.
> >> To post to this group, send email to nodejs@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> nodejs+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: random string in node

2012-05-20 Thread dhruvbird
Why not use uuid? There's a node-uuid module available.

On May 19, 1:25 pm, Dean Mao  wrote:
> Yes, this thread will last until next year, when someone just tells us to
> use the randomString() api and not try to reinvent the wheel.
>
>
>
>
>
>
>
> On Sat, May 19, 2012 at 1:02 AM, Jorge  wrote:
> > On May 18, 2012, at 7:10 AM, Aleksander Adamowski wrote:
> > > On Wednesday, August 3, 2011 12:15:32 PM UTC+2, Jorge wrote:
> > >> Fromhttp://en.wikipedia.org/wiki//dev/random: "The intent is to
> > serve as a cryptographically secure pseudorandom number generator,
> > delivering output with entropy as large as possible. This is suggested for
> > use in generating cryptographic keys for high-value or long-term protection"
>
> > >> $ node
> > >> >function getRandomBytes (howMany) {
> > >>   var fs= require('fs');
> > >>   var bytes= new Buffer(howMany);
> > >>   var fd= fs.openSync('/dev/random', 'r');
>
> > > This is unnecessary, node.js crypto API has a
> >http://nodejs.org/docs/v0.6.1/api/crypto.html#randomBytesfunction that
> > uses OpenSSL RAND_bytes() to handle this task correctly.
> > > 
>
> > I wrote that on August 3, 2011, now look at the date of this:
>
> > $ git log --grep 'implement randomBytes'
> > commit c4eaf7e5a90e0b923c5b1aff3ccef09c8ea064a9
> > Author: Ben Noordhuis 
> > Date:   Thu Sep 22 20:33:58 2011 +0200
>
> >    crypto: implement randomBytes() and pseudoRandomBytes()
>
> > :-P
>
> > Cheers,
> > --
> > Jorge.
>
> > --
> > Job Board:http://jobs.nodejs.org/
> > Posting guidelines:
> >https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to nodejs@googlegroups.com
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: [ANN] i-json a fast (C++) incremental JSON parser

2014-06-02 Thread dhruvbird


On Sunday, June 1, 2014 7:05:58 PM UTC-7, Nuno Job wrote:
>
> why is it different from clarinet or jsonparse[1]?
>
> for what class of application is the difference meaningful?
>
> would be happy to refer to this in the clarinet readme,
>

It would seem that the C++ implementation would be faster than the above 2 
(javascript based) implementations.

Apart from performance, the API of the 3 libraries is very different.
* jsonparse requires an unbound callback (since it passes in data using 
'this') - sounds like a bad idea
* clarinet requires every caller/client to keep track of the current 
value's object nesting by providing a callback for almost every event 
function. Reconstructing the original json can be problematic or time 
consuming for the client. Not to mention the perf. overhead for invoking 
each callback
* otoh, i-json passes in the complete path of the value (assuming it passes 
in integer indexes to denote array indexes in the 2nd parameter of the 
value callback)

Aside: There's a typo in the clarinet readme: "string on number" should be 
"string 
or number".



 

>
> nuno
>
>
> On Sun, Jun 1, 2014 at 12:27 PM, Bruno Jouhier  > wrote:
>
>> Hi Alex,
>>
>> No, I haven't tried C nor Go. The node and v8 API are exposed in C++. 
>> Developing with other languages is trickier (
>> http://stackoverflow.com/questions/12088937/is-it-possible-to-write-node-js-addons-in-go).
>>  
>> Why C or Go? 
>>
>> If your concern is speed, I think that the next step is not to change 
>> language but to hook directly into v8's internals instead of going through 
>> v8's public APIs. This is how JSON.parse is implemented. I measured the 
>> total time spent in the public v8 materialization calls (creating strings, 
>> objects and arrays) and this time alone is equivalent to the total time 
>> used by JSON.parse.
>>
>> Bruno
>>
>>
>> On Sunday, June 1, 2014 5:36:01 AM UTC+2, Alex Yaroshevich wrote:
>>>
>>> Hi Bruno!
>>>
>>> Did you tried to write it on C or Go?
>>>
>>> On Saturday, May 31, 2014 3:12:13 AM UTC+4, Bruno Jouhier wrote:

 I just released a first version of i-json, a fast incremental JSON 
 parser: https://github.com/bjouhier/i-json

 Main features:

- It is FAST :-), but still slower than JSON.parse :-(. On my bench 
(parsing a realistic 8 MB JSON file), it comes out as only 60% slower 
 than 
JSON.parse. In comparison, the pure JS parsers that I have tried are 
 more 
than 6 times slower than JSON.parse. 
- It is incremental and it works directly on buffers (on strings 
too :-). So you can call it directly with buffers that you receive 
 through 
'data' events.
- It can work either as a DOM parser or an evented one (less events 
than SAX but probably enough).
- API is small. The intent is not to provide a sophisticated API 
but a fast engine around which you can build fancier APIs.
- It it implemented in C++ but there is a JS fallback 
implementation in case it does not build. the JS implementation is 2.5 
 to 3 
times slower. I wrote it in JS initially but was not happy with the 
 speed. 
Both implementations pass the unit test suite. 

 Bruno

>>>  -- 
>> Job board: http://jobs.nodejs.org/
>> New group rules: 
>> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
>> Old group rules: 
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "nodejs" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to nodejs+un...@googlegroups.com .
>> To post to this group, send email to nod...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/nodejs/434777fb-9bcf-4cc8-bd37-caffb76b74b0%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/c8e6ed14-4146-4ecb-81f2-63bf97aeb40c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] Has anyone tested node.js with fastsocket?

2014-10-23 Thread dhruvbird
https://github.com/fastos/fastsocket

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/bd9b1644-8e13-40fe-aa82-79fb6cee6716%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.