@@ -234,26 +234,6 @@ httpProxy.createServer({
234
234
}).listen (8014 );
235
235
```
236
236
237
- #### Tracking the redirection
238
- ``` js
239
- //
240
- // Create a proxy server, and not allow redirection breaking the proxy
241
- //
242
- httpProxy .createProxyServer ({
243
- agent : http .globalAgent ,
244
- target: {
245
- protocol: ' http:' ,
246
- host: ' www1.macys.com'
247
- },
248
- headers: {
249
- host: ' www1.macys.com'
250
- },
251
- trapRedirect: {
252
- target: " localhost:8011"
253
- }
254
- }).listen (8011 );
255
- ```
256
-
257
237
Also you can proxy the websocket requests just calling the ` ws(req, socket, head) ` method.
258
238
259
239
``` js
@@ -281,6 +261,26 @@ proxyServer.on('upgrade', function (req, socket, head) {
281
261
proxyServer .listen (8015 );
282
262
```
283
263
264
+ #### Tracking the redirection
265
+ ``` js
266
+ //
267
+ // Create a proxy server, and not allow redirection breaking the proxy
268
+ //
269
+ httpProxy .createProxyServer ({
270
+ agent : http .globalAgent ,
271
+ target: {
272
+ protocol: ' http:' ,
273
+ host: ' www1.macys.com'
274
+ },
275
+ headers: {
276
+ host: ' www1.macys.com'
277
+ },
278
+ trapRedirect: {
279
+ target: " localhost:8011"
280
+ }
281
+ }).listen (8011 );
282
+ ```
283
+
284
284
### Contributing and Issues
285
285
286
286
* Search on Google/Github
@@ -309,7 +309,7 @@ If you would like to track redirection and not allow it breaking your reverse pr
309
309
310
310
* ** trapRedirect** : object to be passed to http(s).request
311
311
* ** trapRedirect.source** (optional): the source domain/url of the redirection starts, by default, ** target.domain** or ** headers.domain** will be used
312
- * ** trapRedirect.target** : the target domain/url you wish the redirection go instead
312
+ * ** trapRedirect.target** : the target domain/url you wish the redirection to go instead
313
313
314
314
### Test
315
315
0 commit comments