Replies: 2 comments
-
|
Hi!
There is an issue about that: #70 Key highlights from that thread:
Dumbproxy grew a lot since then, now it has many other modes of operation besides HTTP proxy:
Obviously, integrating /healthz endpoint straight on main port doesn't make sense in these modes. The solution I see as reasonable is an optional separate HTTP port for healthchecks, just like we have for profiling endpoints. However, it defies the purpose of healthcheck to some degree because these healthchecks won't be even served from the same goroutine accepting connections as main program service.
You can already do that to some degree, reloading and But I think that touches a broader topic. Access filter is just a part of configuration and dumbproxy doesn't have a hot configuration reload. Fork and re-exec are not available on all platforms and there's no safe way to do that kind of reload with Go. What's remaining is to have shared synchronized configuration state, which encumbers all the code with a concurrent access to everything about its configuration. I'd like to keep things simple, so I skipped all that struggle. And apparently it was a good choice: I was asked for hot reload just twice, including this time. And finally, in modern containerized environment even daemons with hot reload do not use that except for ingress controllers. The usual way to do things now is to drain old deployment pods and spawn new with the new configuration, even if daemon supports reload: https://kubernetes.io/docs/tutorials/services/pods-and-endpoint-termination-flow/ In any case, I'd like to learn more about what changes in your access rules. Maybe you can just get away with reloading dataset instead of reloading JS code. Or maybe we should just limit lifetime of each JS VM instance, so they'll pick up new code eventually.
You can format (including JSON) and print any attributes of requests and outcome of your decision right from script with the function access(req, dst, username) {
print(`deny: ${JSON.stringify({reason: "not feeling like doing that", req: req, dst: dst, username: username})}`);
throw newStopAddressIteration();
}will produce log line BTW, project README serves as a complete reference for all available features, all built-in functions are covered there too: https://github.com/SenseUnit/dumbproxy?tab=readme-ov-file#scripting-functions |
Beta Was this translation helpful? Give feedback.
-
IC, I'll try the option variant.
Mhm interesting, that would indeed work -- probably more than I wanted to do in JS but probably okay.
Yes I can get away with reloading the dataset.
Yeah that is certainly true, but that also increases the log noise quite a bit (that said, it is certainly a workable solution). Thank you for your help, I'll see what I can come up with :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am currently looking into dumbproxy to replace a squid based setup with it. What I am currently missing (and wondering whether you'd be okay to add support for those):
What do you think about those, happy to elaborate if anything is unclear.
Beta Was this translation helpful? Give feedback.
All reactions