M
Mikito Takada
blog.mixu.net · Personal blog · on HN since 2010
Mikito Takada writes about node.js, JavaScript patterns, benchmarking, WordPress setup and the startup mindset.
What HN saysHN commenters link his node.js event loop explanation to clarify how Node handles requests, plus his WordPress multisite and SSH tunneling guides.
19HN people shared it
6linked it in comments
17stories submitted
86story points
10 years agolast shared
2010people per year2026
Most-shared posts
- 1Understanding the node.js event loop9 people · 61 points · first shared 2011 · 3 comments on HN
- 2Javascript, node.js and for loops2 people · 6 points · first shared 2011 · discussion on HN
- 3Writing about technical topics like it’s 20122 people · 4 points · first shared 2012 · discussion on HN
- 4Essential Node.js patterns and snippets1 people · 7 points · first shared 2011 · discussion on HN
- 5Learning node.js: my experiences and helpful resources1 people · 2 points · first shared 2011 · discussion on HN
- 6Using Open Source Software in projects: Beware of the passionate liars1 people · 2 points · first shared 2010 · discussion on HN
- 74 simple ways startup people deceive themselves1 people · 2 points · first shared 2010 · discussion on HN
- 8Performance benchmarking a node.js backend1 people · 1 points · first shared 2011 · discussion on HN
- 9How to deploy web applications using Mercurial1 people · 1 points · first shared 2010 · discussion on HN
- 10Nginx websockets ssl and socket io deployment1 people · first shared 2012
- 11Setting up multisite wordpress 3 0 with multiple different domains1 people · first shared 2010
- 12How to watch hulu videos via ssh tunneling1 people · first shared 2012
What HN people wrote when they linked it
Terretta · 2010-06-17
If someone has a recommendation on the best method of configuring this for multiple domains (not subdomains) on a cloud host, I'd appreciate the pointer.
I've found this:
http://blog.mixu.net/2010/05/17/setting-up-multisite-wordpress-3-0-wit…
Which references this:
http://www.interconnectit.com/840/wordpress-3-0-multisite-with-multipl…
These assume you can edit your Apache conf, and many cloud hosts don't support that.
blhack · 2012-04-25
First: node is freaking amazing. I've been writing python CGI on Apache for the last few years, but can easily see myself moving to:
nginx -> Static html/javascript/images/css
node.js -> API
Apache -> old Python CGI stuff I still want (beautiful soup, for instance)
To me, this stack is a lot more comfortable, and is a lot faster.
----
Here are a couple of things that this tut misses.
1) You need to talk to your database. This will become immediately apparent when you try to do anything. You can google around, which will lead you to stack overflow, or you can just listen to me right here and use "mysql".
npm install mysql
Easy.
2) Callbacks. This is freaking huge. node will not make any sense to you if you do not understand this. For instance, if you have a function called "get_username()" (Hi! I have a function called get username, I'm speaking from a mistake I made about this!), and you call it like this:
username = get_username();
res.write("Hi, you are: " + username);
res.end("buhbye!");
Your page is just going to crash because username is undefined. This is because node is nonblocking. It doesn't wait for get_username() to return before continuing...meaning your server will end before get_username() finishes.
This is a problem.
So what you need to do won't make sense at first (and maybe I'm doing this wrong, correct me if I am).
you would do:
get_username(res);
and then you would have:
function…
vectorEQ · 2016-06-14
This might be interesting for you. Sorry not Node expert myself, but it seems to touch some of your question.
http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/
latchkey · 2013-02-18
I think we are saying the same thing. When I say 'it is still only processing one request at a time', I'm referring to my code execution, not the async stuff or anything else within Node.
I found this to be a good explanation...
http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/
lobo_tuerto · 2012-08-21
I know this is a bit different, but maybe you could modify it a bit so you don't need sshuttle?
http://blog.mixu.net/2009/05/05/how-to-watch-hulu-videos-via-ssh-tunne…
Just make your server listen for ssh on port 80 or 443, and then tunnel away!
feralmoan · 2012-01-19
nginx supports http1.1 reverse proxying as of a few weeks ago http://wiki.nginx.org/HttpProxyModule
Mikito Takada (Zendesk) has some really helpful information regarding socket.io + haproxy specific workarounds via http://blog.mixu.net/2011/08/13/nginx-websockets-ssl-and-socket-io-dep…