Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread Felix E. Klee
On Sun, Aug 5, 2012 at 1:23 AM, Oliver Leics wrote: > Maybe it is useful for you. Thanks - looks definitely interesting, although for serving files still a lot of code has to be written. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread Oliver Leics
On Sun, Aug 5, 2012 at 11:31 AM, Felix E. Klee wrote: > On Sun, Aug 5, 2012 at 1:23 AM, Oliver Leics > wrote: >> Maybe it is useful for you. > > Thanks - looks definitely interesting, although for serving files still > a lot of code has to be written. The code to serve files is in examples/serve

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread Oliver Leics
On Sun, Aug 5, 2012 at 11:38 AM, Oliver Leics wrote: > On Sun, Aug 5, 2012 at 11:31 AM, Felix E. Klee wrote: >> On Sun, Aug 5, 2012 at 1:23 AM, Oliver Leics >> wrote: >>> Maybe it is useful for you. >> >> Thanks - looks definitely interesting, although for serving files still >> a lot of code ha

Re: [nodejs] Most efficient way of piping HTTP body through a tunneling proxy

2012-08-05 Thread ajc
Looks great! I'll need to play around with that. I can't be bothered to make my http tunnel disconnect proof though, because I've noticed SSH connections stay open when my wifi has dropped out. John On Friday, August 3, 2012 10:31:38 AM UTC+1, Dominic wrote: > > @john I applaud your efforts for

[nodejs] [ANN] ensure-https

2012-08-05 Thread phidelta
Hi all, I just published a module that is a simple http server that forwards to https. Nothing spectacular, but since it is something that almost all my projects need, I figured packaging it and making it available might be a good thing. Regards, phidelta -- Job Board: http://jobs.nodejs.org

[nodejs] [ANN] seic (Spdy-Express-socket.Io-Cluster)

2012-08-05 Thread phidelta
Hi all, I have just released seic, which is a basic setup package for setting up an HTTPS server with Express, SPDY and Socket.IO enabled and Cluster. In addition there is a facility that enables the workers to easily broadcast events to all workers, so that socketi.io can work across cluster

Re: [nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread Felix E. Klee
On Sun, Aug 5, 2012 at 5:19 PM, Oliver Leics wrote: > https://github.com/oleics/node-filecache/blob/master/examples/server.js This looks really cool! Haven't tried it out in my own project, yet, though. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wi

[nodejs] What's different of requiring json or js?

2012-08-05 Thread Kei Son
I have a huge JSON file, right, it's 78MB. When I just require it from node-cli it takes 450MB memory footprint. I can understand that is bloated 6x times because the JSON file is just a string in the storage, but it needs spaces for indexing, making some padding, optimization, linking and what

[nodejs] using local node modules in repl?

2012-08-05 Thread David Tang
I just downloaded my redis server and installed the redis module in one of my directories. Is it possible to play with the module in the repl? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message

[nodejs] CraftyJS, Node.js, SocketIO, V8 woes.

2012-08-05 Thread Brian Stahly
I am trying to build a small, online card game with NodeJS. Having C# and javascript experience, I am having way more trouble than I expected. Using node-static, I set up an http server (server.js) that successfully serves client.html and any requested assets. I am starting to build the basics o

Re: [nodejs] What's different of requiring json or js?

2012-08-05 Thread Joshua Gross
There may be a better answer for this, but JSON is actually more rigidly structured than standard JavaScript. So, it makes sense to me that a more specialized parser would need more memory than just sending JavaScript code to the VM. -- Joshua Gross Christian / SpanDeX, Inc. / BA Candidate of

Re: [nodejs] CraftyJS, Node.js, SocketIO, V8 woes.

2012-08-05 Thread Karl Tiedt
It seems to work fine in my repl test (and browser test)... The reason splice returns an array is quite simple... thats what splice does ;) https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/splice -Karl Tiedt -- Job Board: http://jobs.nodejs.org/ Posting guidel

Re: [nodejs] Re: libuv exits event loop too early

2012-08-05 Thread Ben Noordhuis
On Sat, Aug 4, 2012 at 9:54 PM, mscdex wrote: > On Aug 4, 3:36 pm, mscdex wrote: >> I have tried manually adding a call to uv_ref() on the uv_poll_t >> handle at different points (e.g. after each call to uv_poll_start), >> but it does not prevent the event loop from exiting early, no matter >> ho

Re: [nodejs] CraftyJS, Node.js, SocketIO, V8 woes.

2012-08-05 Thread Martin Cooper
On Sat, Aug 4, 2012 at 11:40 AM, Brian Stahly wrote: > I am trying to build a small, online card game with NodeJS. Having C# and > javascript experience, I am having way more trouble than I expected. > > Using node-static, I set up an http server (server.js) that successfully > serves client.html

Re: [nodejs] using local node modules in repl?

2012-08-05 Thread Nathan Rajlich
Sure, just require it like usual (assuming it is installed in ./node_modules). var redis = require('redis'); ... On Sat, Aug 4, 2012 at 11:02 AM, David Tang wrote: > I just downloaded my redis server and installed the redis module in one of > my directories. Is it possible to play with th

[nodejs] [ANN]: node-nat-pmp: A Node.js implementation of the NAT Port Mapping Protocol

2012-08-05 Thread Nathan Rajlich
If you've wanted to forward your ports programmatically before, and have a NAT-PMP compatible route (basically an Apple router), then this module is for you. You can get what the router believes is the external IP address, as well as open and close UDP and TCP ports to the computer sending the comm

Re: [nodejs] CraftyJS, Node.js, SocketIO, V8 woes.

2012-08-05 Thread Adam Reynolds
I know this is slightly off-topic but why did you choose crafty over the other game engine that are out there? -- 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

Re: [nodejs] CraftyJS, Node.js, SocketIO, V8 woes.

2012-08-05 Thread Marak Squires
http://eloquentjavascript.net/ On Sat, Aug 4, 2012 at 11:40 AM, Brian Stahly wrote: > I am trying to build a small, online card game with NodeJS. Having C# and > javascript experience, I am having way more trouble than I expected. > > Using node-static, I set up an http server (server.js) that su

Re: [nodejs] [ANN]: node-nat-pmp: A Node.js implementation of the NAT Port Mapping Protocol

2012-08-05 Thread Dan Milon
Unfortunately my router does not support it, but the module seems very neat. Although, security-wise it doesn't seem very nice allowing any app to open any ports. There should be some approval. On 08/06/2012 01:39 AM, Nathan Rajlich wrote: If you've wanted to forward your ports programmaticall

Re: [nodejs] [ANN]: node-nat-pmp: A Node.js implementation of the NAT Port Mapping Protocol

2012-08-05 Thread Marak Squires
Sweet. On Sun, Aug 5, 2012 at 3:39 PM, Nathan Rajlich wrote: > If you've wanted to forward your ports programmatically before, and have a > NAT-PMP compatible route (basically an Apple router), then this module is > for you. You can get what the router believes is the external IP address, > as we

[nodejs] Looking for inspitarion ...

2012-08-05 Thread Seiji Sam Lee
I keep on working in my node-based http server. I am implementing sessions and, into this, installing code to be executed latter. So I found a problem and need a bit of inspiration. The fast way to explain the problem is ask: how can un-bind a variable? well, I have a function: function hel

Re: [nodejs] Looking for inspitarion ...

2012-08-05 Thread Marak Squires
Lot's of things going on here. It's hard to tell without more information, but it looks like you are playing fast and loose with scope. Generally, you shouldn't have to worry about "un-binding" things. Can you post an entire runnable code example? You might want to take a look at http://eloquentj

Re: [nodejs] [ANN]: node-nat-pmp: A Node.js implementation of the NAT Port Mapping Protocol

2012-08-05 Thread Nathan Rajlich
> > Although, security-wise it doesn't seem very nice allowing any app to open > any ports. There should be some approval. You should check out the second paragraph of the "Security Considerations" section of the protocol. Apparently the authors have opposing opinions: http://tools.ietf.org/html/

Re: [nodejs] What's different of requiring json or js?

2012-08-05 Thread Kei Son
makes sense. different parser needs more extra spaces. however the spaces for the parser-only should be freed at gc time, isn't it? 2012년 8월 6일 월요일 오전 5시 31분 3초 UTC+9, Joshua Gross 님의 말: > > There may be a better answer for this, but JSON is actually more rigidly > structured than standard JavaS

Re: [nodejs] What's different of requiring json or js?

2012-08-05 Thread Marak Squires
You might want to consider using a streaming JSON parser. On Sat, Aug 4, 2012 at 7:43 AM, Kei Son wrote: > I have a huge JSON file, right, it's 78MB. > When I just require it from node-cli it takes 450MB memory footprint. I > can understand that is bloated 6x times because the JSON file is just

Re: [nodejs] What's different of requiring json or js?

2012-08-05 Thread Kei Son
Thanks for the idea. But I just want to know why. 2012년 8월 6일 월요일 오전 9시 58분 22초 UTC+9, Marak Squires 님의 말: > > You might want to consider using a streaming JSON parser. > > On Sat, Aug 4, 2012 at 7:43 AM, Kei Son wrote: > >> I have a huge JSON file, right, it's 78MB. >> When I just require it fro

Re: [nodejs] Most efficient way of piping HTTP body through a tunneling proxy

2012-08-05 Thread axs
I tried piping but was having issues: The following code throws an "Cannot call method 'on' of undefined" error at the last line. proxy.on('request', function(req, res){ var uri = url.parse(req.url); var httpMessage = req.method + ' ' + uri.path + ' HTTP/'+ req.httpVersion + '\r\n'; for(var hea

[nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread tjholowaychuk
Don't cache with node, slap varnish in front On Friday, 3 August 2012 07:46:37 UTC-7, Felix E. Klee wrote: > > What is a good module to serve some static (JavaScript) files (including > caching and compression)? > > Desired mapping of files to URLs: > > scripts/*.js -> http://example.com/scri

[nodejs] Re: Serving static files, but not from public directory?

2012-08-05 Thread tjholowaychuk
Though if you are going to cache with node you'll have to do a better job than the hack I did with staticCache(), node-static does it extremely wrong and will give you stale responses and invalid ones at times depending on the request On Sunday, 5 August 2012 21:14:37 UTC-7, tjholowaychuk wrote:

Re: [nodejs] Looking for inspitarion ...

2012-08-05 Thread Jake Verbaten
> My first idea is implement $server (and other globals objects) as pure/complete proxies... Your code structure / design will be a lot better if you stick to a strict no globals policy -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Po