Live data from Hacker News

Redbird: A modern reverse proxy for Node

github.com

21–30 of 77 posts

Re: Redbird: A modern reverse proxy for Node

#21

Earlier quoted context omitted.

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

Its a local installation, inside the folder, instead on the operating system. Also, other people will automatically install it when the package is saves inside the package.json or yarn file. You can also limit the version you want with these files, that the end user dont need to think about. Just yarn install :)

  serv() { docker run --rm --name "nginx-${1:-8000}" -p "${1:-8000}:80" "${@:2}" -v $PWD:/usr/share/nginx/html:ro caub/nginx-dev; }
this is what I do to run a local static server, you could run nginx with a config for proxying on docker as well

also yarn.. bleh, just npm, nowadays it's even faster (on linux)

Re: Redbird: A modern reverse proxy for Node

#22

This looks excellent. Is it intended to be integrated with other Node libs? I.e. can I use it as an express middleware somehow, or is it explicitly intended as a standalone thing - more like Nginx-but-configured-with-JS-instead-of-a-weird-custom-language? I can see value in the latter too, but I'm curious about the motivation here.

Good question. I was also looking for an answer to this.

Would love to add some middleware to turn this into an OAuth2 proxy.

Re: Redbird: A modern reverse proxy for Node

#23

From the roadmap section: Automatic routing via Redis Could anyone explain to me how does this work and what is automatic routing in this context?

I assume that instead of config file (or hardcoded values), they will use Redis store for mapping of the domains/target nodes. E.g. traffic from www.hacker.com is forwarded to 192.168.1.1, and traffic from www.news.com is forwarded to 192.168.1.2.

Re: Redbird: A modern reverse proxy for Node

#24

This looks excellent. Is it intended to be integrated with other Node libs? I.e. can I use it as an express middleware somehow, or is it explicitly intended as a standalone thing - more like Nginx-but-configured-with-JS-instead-of-a-weird-custom-language? I can see value in the latter too, but I'm curious about the motivation here.

Good question. I was also looking for an answer to this. Would love to add some middleware to turn this into an OAuth2 proxy.

I had a similiar thought, although not OAuth2, of integration with something like authelia[1].

[1] https://github.com/clems4ever/authelia

Re: Redbird: A modern reverse proxy for Node

#25
post #5

What are some good practices to install this as a service (to replace apache, for example). Do you just setup a systemd script or you have any common utility for this? I read about pm2 being a common choice. Do you recommend it? Is there any alternative for multiple app types apart from node?

I use PM2. It's very good, and it keeps things in the node ecosystem.

Pm2 isn't the best tool we could have, but it's probably the best one existing.

To all future users: don't call `pm2 start ...` too often one by one (like in .sh script) - it won't start all of these, just some of them (at least on raspberry, maybe faster cpu helps here), use "ecosystem" feature for starting multiple services

Re: Redbird: A modern reverse proxy for Node

#26
I used to use Redbird, but configuration is a bit weird and not very well described if you need to use Auto HTTPS feature. Project seems rather dead and bugs are solved very slow (upgrading to newer node version caused it to not install because of outdated dependency, iirc PR with solution were ready, but not merged for weeks (?)).

Finally I got rid of it and replaced it with Caddy webserver

Re: Redbird: A modern reverse proxy for Node

#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 that?

  [1] https://expressjs.com/en/advanced/best-practice-performance.html

Re: Redbird: A modern reverse proxy for Node

#28
post #7

Earlier quoted context omitted.

https://github.com/webpack/webpack-dev-server Would this work? Or what’s the issue you are referring to?

I'm pretty sure he's aware of Webpack's devserver. A common problem is multiple libraries (with different webpack configs ) being built that are required inside a single app. I guess GP's approach is to run multiple devservers, all on a different port, and then put a reverse proxy in front of it. Last I checked, webpack does support building multiple scripts (by turning the `entry` config setting into an array or obj…

Webpack actually supports exporting an array of configurations. https://github.com/webpack/webpack-dev-server/tree/master/ex...

Re: Redbird: A modern reverse proxy for Node

#29
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…

There are cases when performance is not your main focus but simplicity of use is. Like during development. I'd of course never use this in production, but it's perfect for my development needs.
Post reply on HN