These are chat archives for elazarl/goproxy

23rd
Mar 2015
Elazar Leibovich
@elazarl
Mar 23 2015 14:20
@abourget will be available in ~3 hours for chat.
Alexandre Bourget
@abourget
Mar 23 2015 14:35
ok
@elazarl is there any reason why the TLSConfigFromCA isn't simply an option on the ProxyHttpServer ? and copied to a the ProxyCtx somehow ?
why those callbacks ? doesn't feel idiomatic..
Elazar Leibovich
@elazarl
Mar 23 2015 14:37
TLSConfigFromCA is just a toplevel function
Alexandre Bourget
@abourget
Mar 23 2015 14:37
the function inside TLSCongiFromCA could simply be a method of ProxyCtx, taking the config as a property, or checking the parent ".proxy" .. and falling back to *defaultTLSConfig
yes I see that..
Elazar Leibovich
@elazarl
Mar 23 2015 14:37
How would the user supply a custom one if it's a method of ProxyCtx?
Alexandre Bourget
@abourget
Mar 23 2015 14:37
do you expect some people will use many CA bundles ?
well the only this this function does is sign, and take a CA bundle as a parameter
so the CA bundle could be a property of the HttpServer, which would make a lot of sense..
or if you want to override it per host, you could be able to tweak it in the ProxyCtx.. where it would finally be called
instead of those calls backs, I'd prefer having a rich ProxyCtx, where you can do things, and where you can read rich properties
that would also scale better with new features, because you could easily add properties..
now you need to change the function signatures to change the design.. and it'll always break backwards compatibility
Elazar Leibovich
@elazarl
Mar 23 2015 14:40
Yes. Actually, someone asked for it. And it makes sense. It allows you as much flexibility as you want.
The problem with ProxyCtx, is that you can't easily customize it
Alexandre Bourget
@abourget
Mar 23 2015 14:40
asked for ?
Elazar Leibovich
@elazarl
Mar 23 2015 14:40
Yep, backwards compatibility is a problem
Asked for custom CAs for more than one domain
Alexandre Bourget
@abourget
Mar 23 2015 14:41
oh ok..
Elazar Leibovich
@elazarl
Mar 23 2015 14:41
I'm not 100% concentrated now, so I'm not sure I understood you're suggestion about ProxyCtx.
It'll help if you could write a short usage example
Alexandre Bourget
@abourget
Mar 23 2015 14:41
so for the CA bundle, we could set it as a prop on ProxyHttpServer, which would pass a reference to it on each newly created ProxyCtx, which would be overridable by requests
yeah, ok..
I'll try to think more and prototype a little..
thanks for your feedback
Elazar Leibovich
@elazarl
Mar 23 2015 14:42
Many thanks for the brain storming. Extra pair of eyes always helps
Elazar Leibovich
@elazarl
Mar 23 2015 19:15
@abourget here?