You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interceptors will not apply to WebSocket handshake packets by default. While in some use cases (e.g. changing the WebSocket request path), you can overwrite {@link io.vertx.httpproxy.ProxyInterceptor#allowApplyToWebSocket} method to allow interceptors apply to WebSocket.
124
-
125
123
==== Body filtering
126
124
127
125
You can filter body by simply replacing the original {@link io.vertx.httpproxy.Body} with a new one
@@ -143,27 +141,41 @@ You can change the control, e.g you can send a response immediately to the user-
You can use the {@link io.vertx.httpproxy.interceptors.HeadInterceptor} to change HTTP request/response heads:
147
+
148
+
- request path
149
+
- query params
150
+
- request and response headers
151
+
152
+
A {@link io.vertx.httpproxy.interceptors.HeadInterceptor} is created and configured with a {@link io.vertx.httpproxy.interceptors.HeadInterceptorBuilder}.
147
153
148
-
You can apply header interceptors to change headers from the request and response with common operations:
154
+
The builder methods can be invoked several times.
155
+
Operations on the path will be invoked in the order of configuration.
156
+
That goes for operations on query parameters, request headers and response headers.
157
+
158
+
===== Headers interception
159
+
160
+
You can apply the interceptor to change headers from the request and response with common operations:
You can also refer to {@link io.vertx.httpproxy.interceptors.QueryInterceptor} for more information.
178
+
You can also refer to {@link io.vertx.httpproxy.interceptors.HeadInterceptorBuilder} for more information.
167
179
168
180
==== Body interceptor
169
181
@@ -176,9 +188,11 @@ You can use body interceptor to create body transformations for common data type
176
188
177
189
Please check the {@link io.vertx.httpproxy.interceptors.BodyTransformer} for other supported transformations.
178
190
179
-
==== WebSocket interceptor
191
+
==== Interception and WebSocket upgrades
192
+
193
+
By default, interceptors are not invoked during WebSocket upgrades.
180
194
181
-
You can use WebSocket interceptor to wrap an interceptor to let it allow WebSocket handling:
195
+
To make an interceptor available during the WebSocket handshake, use {@link io.vertx.httpproxy.HttpProxy#addInterceptor(io.vertx.httpproxy.ProxyInterceptor, boolean)}:
0 commit comments