Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Definitely doable with HAProxy + lua. I've used it extensively for load balancing stateful apps.


I'll definitely take a look at this.

What I have in mind isn't really a "proxy" but more of a login/redirection server.

A "proxy" is middleware which directs all communication through a single server which adds to latency.

What I have in mind will run logins through a single server. But once the login is complete, any further communication is redirected to the proper work server to continue without any proxy middleware involved.

This won't entirely eliminate downtime issues but it does limit the effects to a reasonable level while offering increased efficiency and decreased latency.


Start here:

https://github.com/haproxy/spoa-example

https://www.haproxy.com/blog/extending-haproxy-with-the-stre...

We used that to make an SSO login site that works independently on what is on the backend. Logic was basically:

* if there is no/invalid SSO cookie, SPOA set a flag which made haproxy redirect to the SSO app * if there is valid cookie, decode it and send the data (usually just logged user name) to the app in header

Once cookie is correct it doesn't need SSO server so it is pretty fast for users that already logged in.

It can be also used for blocking requests based on external engine, it's pretty flexible overall

https://docs.fastly.com/signalsciences/install-guides/other-...


HAProxy can also do redirects




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: