Re: [nodejs] Re: RFH: Cross-platform binary modules
On Sun, Feb 5, 2012 at 9:39 PM, Isaac Schlueter i...@izs.me wrote: Wow, that looks really cool. The readme doesn't mentioning actually creating a gyp file. You still have to do that, right? It'd be nice to document what it should look like. README updated! Thanks for the shout-out on nodeup today too! On Sun, Feb 5, 2012 at 19:15, Christopher Jeffrey chjjeff...@gmail.com wrote: Works well for me, very painless. I hope others start supporting it soon. On Feb 5, 7:17 pm, Nathan Rajlich nat...@tootallnate.net wrote: Ok I just tagged and published v0.0.1 of node-gyp on npm. Here is the repo:https://github.com/TooTallNate/node-gyp Native addon devs, please try it out and begin migrating your module to using gyp. Let me know about your results!! -- 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
Re: [nodejs] [ANN] JavaScript Jabber Podcast
re build tools, might want to see https://github.com/mosen/buildy On Mon, Feb 6, 2012 at 10:38 AM, Phoscur phos...@pheelgood.net wrote: Hi, I just heard the cast, and I was quite happy that you are talking about a theme I'm still struggeling with: build tools (continue the discussion on this on this topic: https://groups.google.com/group/nodejs/browse_thread/thread/9814da6a8873db2f/fdfaefa8ca5db7aa) First off: Please check the cast quality with some smalltalk before actually casting, because this cast, I'm barely able to understand the person actually talking the most (not loud enough, some kind of room echo). Now I'm not really sure what I take out of this. So, what is really the outcome (and satisfaction of Jamison's wishlist)? Maybe you can summerize the cast focussed on this? The list shows an overview, but not exactly which tool does what good or bad. I'm particulary interested in the non-Ruby based solutions, I don't want to have another scripting language in my code. Nice if you are a Ruby fan and not happy handling JavaScript, but let it be like this, that's your opinion. In the beginning there is something about Source URL, can you give some more information/links on this? Googling on this seems kinda hard. Can you actually create a concatenated file of your source with multiple file debugging expirience? Why is it bad to have browser code in NPM? Thanks for the cast! Ph Am 04.02.2012 05:20, schrieb AJ ONeal: Chuck Wood, Yehuda Katz, Jamison Dance, Peter Cooper, and I (and guest speakers) are doing the JavaScript Jabber podcast. We want to get some direction on which topics to discuss from the Node community. Give us some ideas at jsjabber.uservoice.com This week's episode was a pretty good discussion on build tools. There are new episodes every friday. Discussion summaries and direct downloads available at JavaScriptJabber.com On iTunes itunes.apple.com/us/podcast/javascript-jabber/id496893300 And if you'd like to +1 us, that would be appreciated google.com/search?q=javascript+jabber+itunes Hopefully some of you tune in and find the discussion valuable. AJ ONeal -- 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] [ANN] simpl v0.2.0: Highly pluggable WebSockets framework
Hello everyone, I released simpl v0.2.0 [1] today, which is almost a rewrite of the previous version. The goal now to provide a pluggable/extendable framework over WebSockets, seamless integration with the browser and a consistent api. [1]: https://github.com/stagas/simpl -stagas -- 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] node.native - C++11 port for node
Hi. I've recently started working on this project: https://github.com/d5/node.native Primary goal of the project is to implement the C++ 11 port for the node. It's as easy as node.js. Look at the following code sample using lambda expression: #include iostream #include http.h using namespace native::http; int main() { http server; if(server.listen(0.0.0.0, 8080, [](request req, response res){ res.set_status(200); res.set_header(Content-Type, text/plain); res.end(C++ FTW\n); })) std::cout Server running at http://0.0.0.0:8080/; std::endl; return native::run(); } It's pretty preliminary stage, but, I'm working on adapting any types of callable object (function, functor, stateless, and stated lambda) into callbacks. For the current release, it's mainly based on libuv (https://github.com/joyent/libuv). If you're interested in, please tell me about your ideas, or leave messages at github. Thanks, - Daniel -- 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] How to properly cancel a file uploading request?
Hi all, We are writing a file uploading handler, by using formidable. Since the file could be large, say 50M, we want to cancel the uploading request if some necessary fields are missing or user quota exceeded, so user do not need to wait until the file is completely uploaded to see the response, and save our server from processing the unnecessary uploading request. It works just fine. By using req.client.destroy() or res.connection.destroy(), the browser stops uploading immediately. Until we put it behind a reverse proxy nginx. The nginx server will firstly buffer the whole uploading body before it passes the control to our uploading handler, so we don't have a chance to cancel the uploading before it is completely uploaded. Then we use node-http-proxy to replace the nginx server, which will not buffer the request automatically. But after we cancel the request in the uploading handler, the reverse proxy node-http-proxy server will not do the same to the actual client, which means the browser is still busy uploading. Then we add a proxyError listener to the proxy, like this: server.proxy.on('proxyError', function(err, req, res){ console.log('proxyError:'); console.dir(err); if (err.code === 'ECONNRESET'){ res.connection.destroy(); } }); Sometimes, this will success, if the err is { [Error: socket hang up] code: 'ECONNRESET' }, the connection is successfully reset, and the browser stops uploading right away. But sometime not, if the err is { [Error: write ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'write' }, the res.connection.destroy() will just issue another proxyError: { [Error: write EPIPE] code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }, and the browser continues it's uploading request. Are we doing something wrong here? Any suggestion is appreciated, thanks in advance. Regards, Mophy -- 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] C++ program is slow with node.js
Hi, In a Pyramid (web framework in Python) web application, I compile a C+ + library with SWIG and the program runs in 10s. I would like to migrate the application to node.js (0.6.5) and I have put the library without change in a node-addon, that I compile with node-waf. The file wscript: def set_options(opt): opt.tool_options(compiler_cxx) def configure(conf): conf.check_tool(compiler_cxx) conf.check_tool(node_addon) def build(bld): obj = bld.new_task_gen(cxx, shlib, node_addon) obj.target = serie obj.source = serie.cc The program runs in 20s. Have you any idea for that slowness? That occurs on my personnal computer (mac os x snow Leopard) and also on the Webfaction server on linux (node 0.6.5 also). Greatings. -- 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] node clustered http server workers die with misleading error
Hi, I am running node 0.6.8 on Windows Server 2008 R2. I have a basic 6 worker clustered http server script serving a static file using stream.pipe. I have 13000 http connections attempting to retrieve the static file 60 times over a period of 2 minutes. As the number of connections increase some of the workers die due to an unknown error. The messages from node as follows: C:\filesC:\Program Files (x86)\nodejs\node.exe C:\Program Files (x86)\nodejs\hs.js stream.js:105 throw er; // Unhandled stream error in pipe. ^ Error: OK, success 'C:\files\test.dat' worker 17104 died stream.js:105 throw er; // Unhandled stream error in pipe. ^ Error: OK, success 'C:\files\test.dat' worker 18884 died stream.js:105 throw er; // Unhandled stream error in pipe. ^ Error: OK, success 'C:\files\test.dat' worker 14100 died Would you have any hints or advice concerning the problem? 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: node clustered http server workers die with misleading error
You need to attach an error event listener to the stream. Connections may terminate unexpectedly for a number of reasons. If you don't handle the error, you'll get the behaviour you're seeing now. I was not able to find a way to specify a error handler when using fs.createReadStream(path) for the input (static file). Is this possible? So I tried a 2 step approach using fs.open(path, flags, mode, callback) and then calling fs.createReadStream(null, options) in the open callback with options.fd set approriately With this approach (err, fd) received by the callback is good at the beginning. But subsequently fd becomes 'undefined' and err has 'Error: OK, success 'C:\files\test.dat' with err.errno being 0. Why is fd undefined when there is no apparent error? Is there a way to view underlying errors if any? 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
Re: [nodejs] Re: How to continuously read a file while the file is been writing
Shin, I commented on your gist with code you can use. You just need to modify it to catchup with existing data. Please treat this only as a proof of concept, and be aware you need to handle error unexpected errors like truncated files, deleted files, and so on. Also keep in mind that on OS X fs.watchFile() is still kind of slow, on Linux you will get much faster results. On Mon, Feb 6, 2012 at 1:39 AM, Shin Suzuki shinout...@gmail.com wrote: Marcel, I wrote a simple code with 12 lines to read newly added lines of a file when changes happen, as you do in the previous sample. https://gist.github.com/1750489 However, it couldn't read newly added data (Node v0.6.9, macOS X). Is something wrong with my code? How can your code work without re-opening the file? 2012/2/3 Mi Jun miju...@gmail.com Using fs.watchFile() and fs.read() will force me to re-implement stream.pipe(response) again. Using fs.createReadStream(path, {start:offset}) is much more easier. -- 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
Re: [nodejs] actual request ip address instead of 0.0.0.0?
On Mon, Feb 6, 2012 at 19:15, AJ ONeal coola...@gmail.com wrote: Can someone suggest a strategy for determining which IP address a request came through? I'm not looking for the IP address of the remote. I want the IP address of the server. You mean the address the connection came in on a server with multiple addresses? You can't. It's not a Node limitation, most (all?) operating systems don't provide that information. Bind to each address separately. -- 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: node clustered http server workers die with misleading error
On Mon, Feb 6, 2012 at 19:09, NodeJazz infinic...@gmail.com wrote: I was not able to find a way to specify a error handler when using fs.createReadStream(path) for the input (static file). Is this possible? Yes. var stream = fs.createReadStream(path, options); stream.on('error', function() { /* ... */ }); So I tried a 2 step approach using fs.open(path, flags, mode, callback) and then calling fs.createReadStream(null, options) in the open callback with options.fd set approriately With this approach (err, fd) received by the callback is good at the beginning. But subsequently fd becomes 'undefined' and err has 'Error: OK, success 'C:\files\test.dat' with err.errno being 0. Why is fd undefined when there is no apparent error? Is there a way to view underlying errors if any? What do you mean with 'fd becomes undefined'? Where/when does that happen? A more complete code example would help. -- 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] actual request ip address instead of 0.0.0.0?
I should mention that you can use the same request handler for several http servers. For example. var Http = require('http'); var Stack = require('stack'); var Creationix = require('creationix'); local handler = Stack( Creationix.log(), Creationix.static(/, __dirname, index.html), function (req, res, next) { // custom middleware // ... } ); Http.createServer(handler).listen(80, 65.34.23.44); Http.createServer(handler).listen(80, 65.34.23.45); // ... I just use stack and creationix here because they don't integrate tightly with the http.Server instance like Connect and Express do, but I'm sure the same thing can be done there too. On Mon, Feb 6, 2012 at 1:04 PM, Ben Noordhuis i...@bnoordhuis.nl wrote: On Mon, Feb 6, 2012 at 19:15, AJ ONeal coola...@gmail.com wrote: Can someone suggest a strategy for determining which IP address a request came through? I'm not looking for the IP address of the remote. I want the IP address of the server. You mean the address the connection came in on a server with multiple addresses? You can't. It's not a Node limitation, most (all?) operating systems don't provide that information. Bind to each address separately. -- 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: actual request ip address instead of 0.0.0.0?
local handler = Stack( Too much Lua in your blood! On Feb 6, 1:10 pm, Tim Caswell t...@creationix.com wrote: I should mention that you can use the same request handler for several http servers. For example. var Http = require('http'); var Stack = require('stack'); var Creationix = require('creationix'); local handler = Stack( Creationix.log(), Creationix.static(/, __dirname, index.html), function (req, res, next) { // custom middleware // ... } ); Http.createServer(handler).listen(80, 65.34.23.44); Http.createServer(handler).listen(80, 65.34.23.45); // ... I just use stack and creationix here because they don't integrate tightly with the http.Server instance like Connect and Express do, but I'm sure the same thing can be done there too. On Mon, Feb 6, 2012 at 1:04 PM, Ben Noordhuis i...@bnoordhuis.nl wrote: On Mon, Feb 6, 2012 at 19:15, AJ ONeal coola...@gmail.com wrote: Can someone suggest a strategy for determining which IP address a request came through? I'm not looking for the IP address of the remote. I want the IP address of the server. You mean the address the connection came in on a server with multiple addresses? You can't. It's not a Node limitation, most (all?) operating systems don't provide that information. Bind to each address separately. -- 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: actual request ip address instead of 0.0.0.0?
Lol! At least I used curly braces for the middleware. On Mon, Feb 6, 2012 at 1:59 PM, Christopher Jeffrey chjjeff...@gmail.com wrote: local handler = Stack( Too much Lua in your blood! On Feb 6, 1:10 pm, Tim Caswell t...@creationix.com wrote: I should mention that you can use the same request handler for several http servers. For example. var Http = require('http'); var Stack = require('stack'); var Creationix = require('creationix'); local handler = Stack( Creationix.log(), Creationix.static(/, __dirname, index.html), function (req, res, next) { // custom middleware // ... } ); Http.createServer(handler).listen(80, 65.34.23.44); Http.createServer(handler).listen(80, 65.34.23.45); // ... I just use stack and creationix here because they don't integrate tightly with the http.Server instance like Connect and Express do, but I'm sure the same thing can be done there too. On Mon, Feb 6, 2012 at 1:04 PM, Ben Noordhuis i...@bnoordhuis.nl wrote: On Mon, Feb 6, 2012 at 19:15, AJ ONeal coola...@gmail.com wrote: Can someone suggest a strategy for determining which IP address a request came through? I'm not looking for the IP address of the remote. I want the IP address of the server. You mean the address the connection came in on a server with multiple addresses? You can't. It's not a Node limitation, most (all?) operating systems don't provide that information. Bind to each address separately. -- 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
Re: [nodejs] Re: node clustered http server workers die with misleading error
var stream = fs.createReadStream(path, options); stream.on('error', function() { /* ... */ }); Wouldn't this mean that the error handler is unlikely to be invoked in case of an error during creation/opening of the stream? What do you mean with 'fd becomes undefined'? Where/when does that happen? A more complete code example would help. I meant that the values of (err, fd) received by the open callback change over time. fd is = 0 and err is null in response to the initial http requests. After a few seconds the callback parameter values are ('Error: OK, success 'C:,\files\test.dat', undefined). var fileName = 'C:\\files\\test.dat'; var errHandler = function (exception) { console.log(exception); }; var reqListener = function (req, res) { req.error = errHandler; res.error = errHandler; var openHandler = function (err, fd) { console.log(fd+ ' ' +err); if (fd = 0) { options = {}; options.fd = fd; rdstream = fs.createReadStream(null, options); rdstream.error = errHandler; res.writeHead(200, { 'Content-Type': 'application/octet-stream' }); rdstream.pipe(res); } }; openHandler.res = res; fs.open(fileName, 'r', 0666, openHandler); }; //var hs = http.createServer(reqListener); The output looks like: C:\filesC:\Program Files (x86)\nodejs\node.exe C:\Program Files (x86)\nodejs\hs.js 3 null 3 null 4 null 4 null 5 null 5 null 6 null 6 null 7 null 7 null 8 null 8 null 9 null 9 null 10 null 10 null ... ... ... 2007 null 1831 null 1872 null 2045 null 1907 null 2008 null 2012 null 1873 null 1832 null 2046 null 1908 null 2009 null 2013 null 1833 null 1874 null 2047 null 1909 null 2010 null 2014 null 1875 null 1834 null 2011 null 1835 null 2015 null 1910 null 2012 null undefined Error: OK, success 'C:\files\test.dat' 1876 null 2016 null 1911 null undefined Error: OK, success 'C:\files\test.dat' 1877 null 1912 null 2017 null 1878 null undefined Error: OK, success 'C:\files\test.dat' 1913 null 1879 null undefined Error: OK, success 'C:\files\test.dat' 1914 null 1880 null errors increase in frequency -- -- 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] Isolates removed
Kudos to you Isaac and the node dev community for putting a value on stability with prudent acts and transparent communication. I recently decided to try node despite my sense that it might turn out to be just a little too hot and trendy. I chose to accept that risk. So decisions like this, communicated like this, make me feel very good about investing in node. Thank you! On Feb 3, 2012 2:28 PM, Isaac Schlueter i...@izs.me wrote: The Isolates feature was intended to make it possible to run child_process.fork() in a thread, rather than a full process. The justification was to make it cheaper to spin up new child node instances, as well as allowing for fast message-passing using shared memory in binary addons, while retaining the semantics of node's child_process implementation by keeping them in completely isolated v8 instances. It was a very informative experiment, but has ultimately turned out to cause too much instability in node's internal functionality to justify continuing with it at this time. It requires a lot of complexity to be added to libuv and node, and isn't likely to yield enough gains to be worth the investment. We're going to roll back the changes in master that were added to support Isolates, and instead focus on Domains and other things that promise to increase stability and make debugging easier. This change will land in 0.7.3. It's entirely possible that we may decide to use v8 isolates in some future version of node, but they will not be in 0.8. If you were eagerly looking forward to using this feature, and find yourself shocked or frustrated by this decision, please contact me directly. It's not our intention to leave anyone stuck, and I do understand that this feature was promised for some time. If this causes hardship for you, let's figure out another way to get your use cases handled. It's never easy to back-pedal, but doing experimental things means sometimes finding out that you were headed in the wrong direction. The sooner we make this change, the easier it will be. 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 -- 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] Isolates removed
it might turn out to be just a little too hot and trendy I know it isn't 1.0 but I've been using it in production for a year and loving it. -- 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: Isolates removed
but has ultimately turned out to cause too much instability in node's internal functionality to justify continuing with it at this time. please specify, elaborate, explain or make note upon this conflict, as if in warning to those who would have wished to pursue the cause further. -- 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] [ANN] Flatiron Mailing List
Hey everyone, We're creating a Flatiron mailing list to discuss all things Flatiron! You can find it at: http://groups.google.com/group/flatironjs Flatiron is a full-stack framework for application development with node.js sponsored by Nodejitsu, and includes components for routing urls, building templates, managing document stores, writing plugins, building cli apps and more! You can learn more about Flatiron at http://flatironjs.org . So, whether you want to lend a hand and help make Flatiron great, or would just like a hand writing your first Flatiron application, this new mailing list is the place for you! Hope to see you there, -- Joshua Holbrook Engineer Nodejitsu Inc. j...@nodejitsu.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
Re: [nodejs] Isolates removed
Echoing Mark Hahn... I'm not a slave to version numbers (not naming names, but we all know some 3.x FOSS with beta quality) but I am always wary of hype. And I have to say node lives up to its hype and the dev community has a refreshingly mature dedication for quality. Three cheers! On Feb 6, 2012 3:05 PM, Mark Hahn m...@hahnca.com wrote: it might turn out to be just a little too hot and trendy I know it isn't 1.0 but I've been using it in production for a year and loving it. -- 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 request.pause() get fixed?
oh yay! finally! haha On Feb 6, 1:18 pm, Denis Washington den...@online.de wrote: Am 06.02.2012 20:01, schrieb Igor Zinkovsky: I believe this was fixed in master (https://github.com/joyent/node/ commit/e6b6075024e9f1330575b10d7e6552e1ea6dad56), but will not be back- ported to v0.6. Latest unstable build (v0.7.2) should contain the fix. It works in 0.7.2, thanks! I didn't see any mention in the release notes on the Node blog. Regards, Denis -- 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] [ANN] JavaScript Jabber Podcast
Thanks for the feedback about mics. We are still working out some kinks, so that kind is helpful. I might put words in Yehuda's mouth, but he doesn't like browser code in NPM because it forces you to use CommonJS for your browser code, and he doesn't want to use CommonJS. http://pmuellr.blogspot.com/2011/11/debugging-concatenated-javascript-files.html is a decent overview of sourceURL. I was not familiar with it before Yehuda mentioned it, so I am learning too. -- 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] using HTTPS
I have a simple HTTPS server that is very similar to the one in the documentation for the HTTPS module. When I run it, I get Error: addListener only takes instances of Function from the createServer call. Any idea what I might be doing wrong? var fs = require('fs'); var https = require('http'); var opts = { key: fs.readFileSync('mykey.pem'), cert: fs.readFileSync('mycert.pem') }; https.createServer(opts, function (req, res) { console.log('url =', req.url); res.statusCode = 200; res.end('Hello, World!'); }).listen(3002); -- R. Mark Volkmann Object Computing, Inc. -- 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] using HTTPS
What version of node? On Feb 6, 2012, at February 6, 20129:28 PM, Mark Volkmann wrote: I have a simple HTTPS server that is very similar to the one in the documentation for the HTTPS module. When I run it, I get Error: addListener only takes instances of Function from the createServer call. Any idea what I might be doing wrong? var fs = require('fs'); var https = require('http'); var opts = { key: fs.readFileSync('mykey.pem'), cert: fs.readFileSync('mycert.pem') }; https.createServer(opts, function (req, res) { console.log('url =', req.url); res.statusCode = 200; res.end('Hello, World!'); }).listen(3002); -- R. Mark Volkmann Object Computing, Inc. -- 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] using HTTPS
Hi, var https = require('http'); require('https') ^ :) On Mon, 6 Feb 2012 20:28:27 -0600, Mark Volkmann r.mark.volkm...@gmail.com wrote: I have a simple HTTPS server that is very similar to the one in the documentation for the HTTPS module. When I run it, I get Error: addListener only takes instances of Function from the createServer call. Any idea what I might be doing wrong? var fs = require('fs'); var https = require('http'); var opts = { key: fs.readFileSync('mykey.pem'), cert: fs.readFileSync('mycert.pem') }; https.createServer(opts, function (req, res) { console.log('url =', req.url); res.statusCode = 200; res.end('Hello, World!'); }).listen(3002); -- R. Mark Volkmann Object Computing, Inc. -- 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 properly cancel a file uploading request?
Hi AJ, Thank you for your reply. But it seems that doesn't stop the uploading at all. The server continues getting the formidable progress event, and the browser is still uploading, and the 'upload limit exceeded' message is shown after the file is completely uploaded. Regards, Mophy On Feb 7, 1:52 am, AJ ONeal coola...@gmail.com wrote: How about req.pause() res.status = 400; res.end('upload limit exceeded'); That will stop the data from coming in and the client may stay connected despite your response, but should eventually timeout in a harmless fashion. AJ ONeal On Mon, Feb 6, 2012 at 8:03 AM, Mophy Xiong mophy...@gmail.com wrote: Update: After changing the following line: if (err.code === 'ECONNRESET'){ to: if (err.code === 'ECONNRESET' || err.code === 'EPIPE'){ We do can always cancel the request now. But we don't know if this will cause any potential problems, like file/device handle/id problem or any other OS level problems. So, if you can figure it out, please let us know. In another hand, we found after we canceled the uploading request, there will be 1 or 2 or 3 segment files lay in the uploading directory. And this is not from the reverse proxy, 'cause they will show up even if we access the upload handler directly. For example, after we canceled the uploading abc.7z (of 10M size), there will be _random_name_a.7z, _random_name_b.7z in the uploading directory (yes, we did emptied this directory before uploading). Each segment file may be 32K or 64K size. Dose this means we didn't cancel the request gracefully or something else? Thanks in advance. Regards, Mophy On Feb 6, 1:16 pm, Mophy Xiong mophy...@gmail.com wrote: Hi all, We are writing a file uploading handler, by using formidable. Since the file could be large, say 50M, we want to cancel the uploading request if some necessary fields are missing or user quota exceeded, so user do not need to wait until the file is completely uploaded to see the response, and save our server from processing the unnecessary uploading request. It works just fine. By using req.client.destroy() or res.connection.destroy(), the browser stops uploading immediately. Until we put it behind a reverse proxy nginx. The nginx server will firstly buffer the whole uploading body before it passes the control to our uploading handler, so we don't have a chance to cancel the uploading before it is completely uploaded. Then we use node-http-proxy to replace the nginx server, which will not buffer the request automatically. But after we cancel the request in the uploading handler, the reverse proxy node-http-proxy server will not do the same to the actual client, which means the browser is still busy uploading. Then we add a proxyError listener to the proxy, like this: server.proxy.on('proxyError', function(err, req, res){ console.log('proxyError:'); console.dir(err); if (err.code === 'ECONNRESET'){ res.connection.destroy(); } }); Sometimes, this will success, if the err is { [Error: socket hang up] code: 'ECONNRESET' }, the connection is successfully reset, and the browser stops uploading right away. But sometime not, if the err is { [Error: write ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'write' }, the res.connection.destroy() will just issue another proxyError: { [Error: write EPIPE] code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }, and the browser continues it's uploading request. Are we doing something wrong here? Any suggestion is appreciated, thanks in advance. Regards, Mophy -- 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: How to continuously read a file while the file is been writing
Also keep in mind that this code is horribly broken and full of race conditions :) On Mon, Feb 6, 2012 at 1:32 PM, Marcel Laverdet mar...@laverdet.com wrote: Shin, I commented on your gist with code you can use. You just need to modify it to catchup with existing data. Please treat this only as a proof of concept, and be aware you need to handle error unexpected errors like truncated files, deleted files, and so on. Also keep in mind that on OS X fs.watchFile() is still kind of slow, on Linux you will get much faster results. On Mon, Feb 6, 2012 at 1:39 AM, Shin Suzuki shinout...@gmail.com wrote: Marcel, I wrote a simple code with 12 lines to read newly added lines of a file when changes happen, as you do in the previous sample. https://gist.github.com/1750489 However, it couldn't read newly added data (Node v0.6.9, macOS X). Is something wrong with my code? How can your code work without re-opening the file? 2012/2/3 Mi Jun miju...@gmail.com Using fs.watchFile() and fs.read() will force me to re-implement stream.pipe(response) again. Using fs.createReadStream(path, {start:offset}) is much more easier. -- 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 -- 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: Functional Testing Report
On Jan 22, 6:12 am, Senthil kumar pen...@gmail.com wrote: Hi, Can anyone point me out which is the best node module to write the functional test cases which should also generates xml report like nodeunit. nodeunit is well suited for unit test cases. I am using soda for functional testcases i don't know whether it generates xml report. Can someone point me out which module is the correct one? Thanks Senthil The difference between function and unit testing is that in unit testing you mock out anything other than the unit being tested. In functional testing you do not mock anything out, and also your testing focus is more on end-user stuff a.k.a. user-acceptance In other words, there isn't exactly a difference in test harness or reporting requirements needed. There might not be a need to use a different harness for functional testing than for unit testing, and it's quite possible to use the JUnit or TAP or whatever report format for functional test reports. + David Herron author: Node Web Development http://nodejs.davidherron.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: how to invoke nodJs file using Java
Use java.lang.System.exec to run a Node.js app at command line On Jan 22, 12:14 pm, pushpinder rattan pushirat...@gmail.com wrote: folks, I am working on writing a REST client in nodejs. Though the client is ready and working fine. But I need to programmatically invoke the client node.js file using Java. Is there any way to do so? -Pushpinder -- 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] bundle javascript for reuse in the browser
Splitting this from Build tool. What I want: -given entry.js, the tool has to resolve it's dependencies inspecting require, recursivly including all relevant files -conviently do jslint/hint checks as codestrings are already loaded -possibility to minify for production -filewatching and possibly caching To sum up for now: -browserify https://github.com/substack/node-browserify: still the mightiest for this task I've seen. Does basically all mentionend above. But it's just works(TM) just won't work for me. I keep running into bugs or bad documentation. -browserbuild https://github.com/LearnBoost/browserbuild: KISS implementation, combining all available source files and a simple browserside require() replacement -pakmanager https://github.com/coolaj86/node-pakmanager: like browserbuild, but with ender.js require() implementation. The last two don't satisfy my needs. Lazy- or Preload modules: Also I noticed that browserify and browserbuild use lazy module loading. So the source of each file is wrapped in a function which is invoked the first time a module is required. I had implemented this diffrently before: I just wrapped a closure around each file source to execute when it's loaded. I think it's better to preload all libraries and prototypes like I did, although I'm not sure if this would have impact on the responsiveness of the interface. Better a long load in the beginning that lags in the first minutes. The algorithm for preloading addintionally has to include some sorting to execute the files in the right order. regards, Ph I wrote: Yeah, of course. But browserify does this better as anything else, and it's IMO the most important part of the JavaScript build process. So a lot of focus should go on this and every single nodejs build tool should support it by default. Just specifying one file to start this assembly and then adding all required files and modules recursivly seems to be the right approch for me. Right? Running that through jslint/hint and running tests aswell as diffrent dev/production versions seems to me all a build tool for nodejs needs to do. I don't see any build tool available which does this well enough. hij1nx wrote: You could call Browserify a build tool, but it has a single purpose (which is good!), it will bundle your commonjs for use in the browser. But a lot of the tools mentioned are more general purpose software build tools. -- Paolo Fragomeni Co-founder, CTO Nodejitsu, Inc. www.twitter.com/hij1nx www.github.com/hij1nx -- 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: New gatekeeper
Ryan, Only time will tell, but I think historians will count you among those who have have moved the discipline a step forward. You join an august group of engineers who have followed s similar path: a brilliant insight, an elegant implementation, a select team. The codebase will have its long run, and will eventually be replaced by something better. But the ideas embodied in node are with us forever. You have made the whole world better with your mind and your two hands. Thank you. -George -- 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] using HTTPS
2012/2/6 Koichi Kobayashi koic...@improvement.jp Hi, var https = require('http'); require('https') ^ :) On Mon, 6 Feb 2012 20:28:27 -0600, Mark Volkmann r.mark.volkm...@gmail.com wrote: I have a simple HTTPS server that is very similar to the one in the documentation for the HTTPS module. When I run it, I get Error: addListener only takes instances of Function from the createServer call. Any idea what I might be doing wrong? var fs = require('fs'); var https = require('http'); var opts = { key: fs.readFileSync('mykey.pem'), cert: fs.readFileSync('mycert.pem') }; https.createServer(opts, function (req, res) { console.log('url =', req.url); res.statusCode = 200; res.end('Hello, World!'); }).listen(3002); -- R. Mark Volkmann Object Computing, Inc. -- 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 First sorry my english, i can read, but not write god :P Realy i'dont like mange the ssl and gzip from aplication side, you can use a reverse proxy like nginx or pound for work with ssl/gzip with the client and palin/text comunication with the backends, is a god idea for escalation to. ex, in pound you can: ListenHTTPS Address 50.33.231.23 # public ip Port 443 # public port, https Cert /etc/pound/server.pem #cert file Service BackEnd Address 127.0.0.1 #localhost Port 3000 # you app port (http plain) End End End With nginx you can: server { server_name yourdomain.com; listen 443; ssl on; ssl_certificate /usr/local/nginx/conf/server.crt; ssl_certificate_key /usr/local/nginx/conf/server.key; # for static files location ~ \.(jpg|css|js|png|ttf|txt|gif|ico)$ { root /path/of/static } # rest location / { proxy_pass http://lolcahost:3000; # Your app open port proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; # remember use this header for remote addr proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; # to know original protocol usage } } -- El Tio ~ Programador, hacker y filósofo web: http://blog.exodica.com.ar Linked'in: http://www.linkedin.com/in/ogentilezza Twitter: @exos http://twitter.com/exos, Indeti.ca: @exoshttp://identi.ca/exos Tels: [+54 11] 638-LINUX (54689) - [+54 9 11] 6799-4797 -- 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] bundle javascript for reuse in the browser
Here is what I do: 1. Leverage the YUI3 module system: http://yuilibrary.com/yui/docs/yui/yui-loader-ext.html 2. Define my own modules within those conventions. 3. Use a combo handler: https://github.com/rgrove/combohandler I use a slightly modified one which runs the resulting file through uglify and caches the result. Why? 1. Because I find YUI3 awesome and leverage it anyway, it has an ecosystem which includes profiling, tests, doc generation, build tools - and then everything else you might expect from a modern js lib / framework, plus excellent documentation. 2. Because it is flexible and offers a number of advantages; I can choose to hand-roll the dependency hierarchy while sketching it out, then move on to automating it from build tools. I can choose if I want to load the minified, debug instrumented or plain raw version of a given file, I can even choose to load the tests for it alongside. 3. The combo loader system is smart enough to only load what is actually needed on a given page, if a module is already on the page it doesn't get loaded twice, I'm not stuck with a monolithic file ( though I can choose to go that path in practice if it has actual benefit for the situation ), I can *still* choose what flavor the module that I wan't to load, on the fly, in production. It ends up something like: script charset=utf-8 src= /js/?/yui3/build/classnamemanager/classnamemanager-min.jsyui3/build/oop/oop-min.jsyui3/build/event-custom-base/event-custom-base-min.jsyui3/build/dom-core/dom-core-min.jsyui3/build/dom-base/dom-base-min.jshttp://dating.datingvip.dev:3000/js/?/yui3/build/classnamemanager/classnamemanager-min.jsyui3/build/oop/oop-min.jsyui3/build/event-custom-base/event-custom-base-min.jsyui3/build/dom-core/dom-core-min.jsyui3/build/dom-base/dom-base-min.jsyui3/build/selector-native/selector-native-min.jsyui3/build/selector/selector-min.jsyui3/build/node-core/node-core-min.jsyui3/build/node-base/node-base-min.jsyui3/build/event-base/event-base-min.jsyui3/build/event-delegate/event-delegate-min.jsyui3/build/node-event-delegate/node-event-delegate-min.jsyui3/build/array-extras/array-extras-min.jsyui3/build/attribute-core/attribute-core-min.jsyui3/build/base-core/base-core-min.jsyui3/build/event-custom-complex/event-custom-complex-min.jsyui3/build/attribute-events/attribute-events-min.jsyui3/build/attribute-extras/attribute-extras-min.jsyui3/build/attribute-base/attribute-base-min.jsyui3/build/base-base/base-base-min.jsyui3/build/base-build/base-build-min.jsyui3/build/history-base/history-base-min.jsyui3/build/event-synthetic/event-synthetic-min.jsyui3/build/history-html5/history-html5-min.jsyui3/build/history-hash/history-hash-min.jsyui3/build/history-hash-ie/history-hash-ie-min.jsyui3/build/router/router-min.jsyui3/build/pjax-base/pjax-base-min.jsyui3/build/view/view-min.jsyui3/build/app-base/app-base-min.jsyui3/build/escape/escape-min.jsyui3/build/handlebars-base/handlebars-base-min.jsyui3/build/handlebars-compiler/handlebars-compiler-min.jsyui3/build/event-key/event-key-min.jsyui3/build/dom-style/dom-style-min.jsyui3/build/node-style/node-style-min.jsyui3/build/transition/transition-min.jsyui3/build/cookie/cookie-min.jsyui3/build/intl/intl-min.js async /script You could fairly easily do your jslinting as part of the build process for individual files, or pull out predefined 'monolithic' files from the combohandler where you then do the jslinting in that part of the stack. Preloading / lazyloading ability is built-in. See: https://github.com/ericf/photosnear.me for a full-app example of how it can be leveraged. On Tue, Feb 7, 2012 at 12:27 PM, Phoscur phos...@pheelgood.net wrote: Splitting this from Build toolhttps://groups.google.com/group/nodejs/browse_thread/thread/9814da6a8873db2f/fdfaefa8ca5db7aa. What I want: -given entry.js, the tool has to resolve it's dependencies inspecting require, recursivly including all relevant files -conviently do jslint/hint checks as codestrings are already loaded -possibility to minify for production -filewatching and possibly caching To sum up for now: -browserify https://github.com/substack/node-browserify: still the mightiest for this task I've seen. Does basically all mentionend above. But it's just works(TM) just won't work for me. I keep running into bugs or bad documentation. -browserbuild https://github.com/LearnBoost/browserbuild: KISS implementation, combining all available source files and a simple browserside require() replacement -pakmanager https://github.com/coolaj86/node-pakmanager: like browserbuild, but with ender.js require() implementation. The last two don't satisfy my needs. Lazy- or Preload modules: Also I noticed that browserify and browserbuild use lazy module loading. So the source of each file is wrapped in a function which is invoked the first time a module is required. I had implemented this diffrently before: I just wrapped a closure around each file source to execute when it's loaded. I
Re: [nodejs] Will request.pause() get fixed?
This is not a bugfix, IMO, it's a feature. A feature we all want, a feature that fixes something newcomers trip on often, but previous released *intended* for the behavior to be the way it was and we have now changed it because this new way is better. It's a feature, it won't be backported. On Feb 6, 2012, at February 6, 201211:55 PM, Mophy Xiong wrote: We really think such bug fixes should be ported to CURRENT STABLE build, before the newly stable version is out. Because people are not recommended to work on unstable builds for productions, but current stable wouldn't get fixed. Then all we can do is wait? :-) Well, if the porting is tough due to differences between 0.7 and 0.6, then forget this ;-) Regards, Mophy On Feb 7, 3:01 am, Igor Zinkovsky izinkov...@gmail.com wrote: I believe this was fixed in master (https://github.com/joyent/node/ commit/e6b6075024e9f1330575b10d7e6552e1ea6dad56), but will not be back- ported to v0.6. Latest unstable build (v0.7.2) should contain the fix. -- 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 request.pause() get fixed?
Well, if this is not treated as a bugfix, it makes sense not backporting it. Regards, Mophy On Feb 7, 2:47 pm, Mikeal Rogers mikeal.rog...@gmail.com wrote: This is not a bugfix, IMO, it's a feature. A feature we all want, a feature that fixes something newcomers trip on often, but previous released *intended* for the behavior to be the way it was and we have now changed it because this new way is better. It's a feature, it won't be backported. On Feb 6, 2012, at February 6, 201211:55 PM, Mophy Xiong wrote: We really think such bug fixes should be ported to CURRENT STABLE build, before the newly stable version is out. Because people are not recommended to work on unstable builds for productions, but current stable wouldn't get fixed. Then all we can do is wait? :-) Well, if the porting is tough due to differences between 0.7 and 0.6, then forget this ;-) Regards, Mophy On Feb 7, 3:01 am, Igor Zinkovsky izinkov...@gmail.com wrote: I believe this was fixed in master (https://github.com/joyent/node/ commit/e6b6075024e9f1330575b10d7e6552e1ea6dad56), but will not be back- ported to v0.6. Latest unstable build (v0.7.2) should contain the fix. -- 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] bug of listening on a used port in worker of cluster ?
When listen on a used port in worker(child processes) of cluster, EADDRINUSE will not be emitted, and server listen on a random port. But in master, it emmits EADDRINUSE error, which is expected. Is it a bug in child process? -- 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: Cannot set memory limit
http://code.google.com/p/v8/wiki/V8Profiler https://github.com/dannycoates/node-inspector https://github.com/smtlaissezfaire/ndb you would use 0.4.x version in order to compile v8-profiler. -- Soo Hwan On Jan 10, 7:09 am, C. Mundi cmu...@gmail.com wrote: What runtime memory profilers are used in the node/V8 world? On Jan 10, 2012 3:22 AM, Marcel Laverdet mar...@laverdet.com wrote: The unit for --max-old-space is MB. On 32-bit systems you can't set it past 2GB (or maybe a bit below that). On 64-bit systems there's pretty much no limit. There is an outstanding issue with garbage collection (see v8 issue 1458) where applications may run slower than they should when the heap becomes large. On Tue, Jan 10, 2012 at 3:31 AM, Phoscur phos...@pheelgood.net wrote: You might have a memory leak somewhere in your code. Try to reuse objects instead of creating a lot of new ones. Memory leaks are difficult to find, I had one when I had a mistake in an if statement for a lazy object creation. The object was created each time. I don't know what the memory limit for node is, where is the documentation of this? Am 09.01.2012 15:25, schrieb Rambo: Can anyone confirm which is the actual memory limit for 32 and 64 bit systems nowadays? It seems to be changing every day, it's confusing. I'm hitting memory limit in all my scripts and I do not know what to do. --max-old-space-size parameter receives a number in bytes? Setting --max-old-space-size=1900 throws me this error... FATAL ERROR: v8::Context::New() V8 is no longer usable. I have a really simple script that does like hundreds of API requests, filters results and adds them to the database, what on earth could me consuming so much memory? Does Node manage memory used by external http requests? or any memory used by asynchronous operations affect the node process? Thanks for your help. -- 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 -- 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