eclipse-vertx / vertx-http-proxy

vertx http proxy
Eclipse Public License 2.0
56 stars 36 forks source link

Variable from interceptor to originSelector #35

Open zenios opened 2 years ago

zenios commented 2 years ago

Sometimes we might want to assign a variable inside an interceptor that will help the origin selector to decide the actual origin. What is the optimal way to do these as of now. I searched and could not find anything

dinstone commented 2 years ago

This is really a good question. I think setting the origin selector to return request options can solve the problem. originSelector(Function<HttpServerRequest, Future<RequestOptions>> selector)

vietj commented 1 year ago

I think we could resolve the origin server before the interceptors kick-in and then it would be exposed in the ProxyContext and can be overriden, or something like that .

vietj commented 1 year ago

sometimes the ProxyContext is not available for a resolution, e.g in the WebSocket case, so we need to come with an interface that provides similar info for this case