Live data from Hacker News

Redbird: A modern reverse proxy for Node

github.com

61–70 of 77 posts

Re: Redbird: A modern reverse proxy for Node

#62
post #50

Earlier quoted context omitted.

Sure, I mentioned Tornado a few minutes before you posted this. Twisted obviously counts too, I dislike the non-PEP8 coding style it uses but that's off topic. I love Python's non blocking features, they're just not in the mainline VM right now. Here's hoping for a libuv or whatever else non blocking Python 4 VM / stdlib.

Asyncio has been in the the mainline VM for quite some time.

Yep, the stdlib just needs to use it. In nodeland blocking is the exception: that's not yet the case in Python.

Re: Redbird: A modern reverse proxy for Node

#63

Earlier quoted context omitted.

Convenience is one I've used redbird to create a local dev proxy that can run be via npm scripts (which were already in the repo) so our engineering team didn't have to run the entire constellation of docker containers if they were only working on frontend code, and the only setup required was `npm install` which they already needed to do I do wish you could just `npm install nginx` though

how would npm install nginx be different from [yum|apt] install nginx?

I'd like to double-down here on the benefit of having a local installation of a reverse proxy vs what yum/apt gives you.

Though this is the main reason I use Caddy over Nginx. I have my Caddy executable and config for all my projects right there in the home root. I ssh into one of my cheap vps and I'm an `ls` away from remembering how to configure it.

Meanwhile, every time I use Nginx I have to remember where the different folders are that it uses, where the configs are, and how to even start/stop/reload it. I usually symlink its config to the home root and paste a few common commands into ~/README.md for future-me.

Obviously, at a larger scale where you're automating your machines, this doesn't really matter. But at any scale under that where you're sshing into different machines, it becomes a nice to have.

Re: Redbird: A modern reverse proxy for Node

#64
post #2

Was recently looking for a reverse proxy for a project at work that utilizes multiple webpack repos that eventually gets built into one big webapp. Without a proxy your forced to only work on one area of the app at once so hopefully something like this will let me run all webpack instances under the same endpoint during dev.

I use hoxy[1] for a lot of similar use cases, e.g. integration testing third party code.

[1] https://github.com/greim/hoxy

Re: Redbird: A modern reverse proxy for Node

#65
post #27

I am one of those JS guys who like to put JS/Node.js everywhere, but I do not get the problem Redbird is trying to solve: the Express.js doc is quite clear that for serious things, you should use a dedicated http server. [1] If you just want reverse-proxying, you can choose between the simplicity of Caddy or the power of Nginx (or Apache). Why would I want to run a JS app (that I know will be less performant) to do t…

> If you just want reverse-proxying, you can choose between the simplicity of Caddy or the power of Nginx (or Apache). Why would I want to run a JS app (that I know will be less performant) to do that?

I don't have the numbers to back this up, but I would be inclined to believe that a Node.js implemented reverse-proxy would outperform Apache.

Re: Redbird: A modern reverse proxy for Node

#66
post #34
post #27

I am one of those JS guys who like to put JS/Node.js everywhere, but I do not get the problem Redbird is trying to solve: the Express.js doc is quite clear that for serious things, you should use a dedicated http server. [1] If you just want reverse-proxying, you can choose between the simplicity of Caddy or the power of Nginx (or Apache). Why would I want to run a JS app (that I know will be less performant) to do t…

- node (whose main reason for existing is event driven IO) is in the same order of magnitude as nginx (whose main reason for existing is also event driven IO). I think sometimes people think node is ruby/python/php levels of performance. It isn't. - And as another comment mentions, developer productivity may be better than minor performance difference - you mentioned Caddy, same rationale applies here. - nginx is als…

> I think sometimes people think node is ruby/python/php levels of performance. It isn't.

Except, it is ruby/python/php slow: https://www.techempower.com/benchmarks/#section=data-r17&hw=...

All of PHP, Ruby, and Python beat Node.js in the above-linked benchmark.

Re: Redbird: A modern reverse proxy for Node

#68
post #66
post #34

Earlier quoted context omitted.

- node (whose main reason for existing is event driven IO) is in the same order of magnitude as nginx (whose main reason for existing is also event driven IO). I think sometimes people think node is ruby/python/php levels of performance. It isn't. - And as another comment mentions, developer productivity may be better than minor performance difference - you mentioned Caddy, same rationale applies here. - nginx is als…

> I think sometimes people think node is ruby/python/php levels of performance. It isn't. Except, it is ruby/python/php slow: https://www.techempower.com/benchmarks/#section=data-r17&hw=... All of PHP, Ruby, and Python beat Node.js in the above-linked benchmark.

Raw number crunching performance is similar with Node and Go. Python and ruby are in different league than them. https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Re: Redbird: A modern reverse proxy for Node

#69

I mostly agree with the sentiment in other comments of just using nginx, but there is one standout feature here that looks incredibly useful: > We have now support for automatic generation of SSL certificates using LetsEncrypt. Zero config setup for your TLS protected services that just works. I've scripted this kind of letsencrypt certs automation before with certbot and nginx, which is fine but a 'just works' decla…

You can use acme.sh to automate certificate issuing, installation, verification, renewal and some server configuration: https://github.com/Neilpang/acme.sh

Re: Redbird: A modern reverse proxy for Node

#70
post #55

Earlier quoted context omitted.

I agree with the sentiment, but using nginx as a proxy is reasonably easy (at least after you make one that works and can reuse that configuration.) The advantage of developing on as similar a platform to the projected production platform is that when you do deploy to a real environment, there are fewer nasty surprises.

How easy is it to use nginx for dynamic proxying? Wondering, because the need I have is to be able to dynamically route requests to ephemeral flask apps that could be on a different host/port at any given moment. Not my design BTW, but it's what I need to do. The thought was to have node manage the flask processes and another tracker service which would dynamically proxy to the apps. Can nginx provide this? Forgive m…

nginx is just a web server so it doesn't have dynamic programming capabilities. However, if you wanted to do something like that from nginx you could script it in Lua using OpenResty https://github.com/openresty/
Post reply on HN