-
Notifications
You must be signed in to change notification settings - Fork 170
/
Copy pathReadme.md
76 lines (64 loc) · 2.73 KB
/
Readme.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Camel proxy policy
You can use this policy to define an Apache Camel proxy where the traffic is sent
over the defined proxy. The example traffic flow is as follows:
```
,-.
`-'
/|\
| ,-------. ,---------. ,----------.
/ \ |APIcast| | CAMEL | |APIBackend|
User `---+---' `----+----' `----------'
| GET /resource | | |
| --------------->| | |
| | | |
| | Get /resource | |
| |------------------>| |
| | | |
| | | Get /resource/ |
| | | - - - - - - - - - >|
| | | |
| | | response |
| | |<- - - - - - - - - -|
| | | |
| | response | |
| |<------------------| |
| | | |
| | | |
| <---------------| | |
User ,---+---. ,----+----. ,----------.
,-. |APIcast| | CAMEL | |APIBackend|
`-' `-------' `---------' `----------'
/|\
|
/ \
```
## Configuration
```
"policy_chain": [
{
"name": "apicast.policy.apicast"
},
{
"name": "apicast.policy.camel",
"configuration": {
"http_proxy": "http://192.168.15.103:8080/",
"https_proxy": "http://192.168.15.103:8443/",
"all_proxy": "http://192.168.15.103:8080/"
}
}
]
```
- If `http_proxy` or `https_proxy` is not defined, the `all_proxy` setting is used.
## Caveats
- This policy will disable all load-balancing policies and traffic will be
always sent to the proxy.
- If the `HTTP_PROXY`, `HTTPS_PROXY` or `ALL_PROXY` parameters are defined, this
policy will overwrite those values.
- Proxy connection does not support authentication. If you need authentication,
please use the headers policy.
## Example use case
This policy is designed to to apply more fined-grained policies and transformation
using Apache Camel.
This [example project](https://github.com/zregvart/camel-netty-proxy) shows an
HTTP proxy that transforms the response body from the API
backend to uppercase.