A service proxy can be deployed on front of a Web server, Web Service or a REST resource. It conceals the server and offers the same interface as the target server to its clients.
Syntax
serviceProxy:
'$ref': <string>
flow:
- <flow>
host: <string>
ip: <string>
method: <string>
name: <string>
path: {}
port: <number>
ssl: {}
target: {}
serviceProxy:
'$ref': <string>
flow:
- <flow>
host: <string>
ip: <string>
method: <string>
name: <string>
path: {}
port: <number>
ssl: {}
target: {}
Sample
<serviceProxy port="80">
<response>
<transform xslt="customer2person.xsl" />
</response>
<target host="www.thomas-bayer.com" port="80" />
</serviceProxy>
<serviceProxy port="80">
<response>
<transform xslt="customer2person.xsl" />
</response>
<target host="www.thomas-bayer.com" port="80" />
</serviceProxy>
Attributes
| Name | Required | Default | Description | Examples |
|---|---|---|---|---|
| $ref | false | - | Reference a component defined under components. | - |
| host | false | not set | A space separated list of hostnames. If set, Membrane will only consider this rule, if the "Host" header of incoming HTTP requests matches one of the hostnames. The asterisk '*' can be used for basic globbing (to match any number, including zero, characters). | predic8.de *.predic8.de |
| ip | false | not set | If present, binds the port only on the specified IP. Useful for hosts with multiple IP addresses. | 127.0.0.1 |
| method | false | * | If set, Membrane will only consider this rule, if the method (GET, PUT, POST, DELETE, etc.) header of incoming HTTP requests matches. The asterisk '*' matches any method. | GET |
| name | false | By default, a name will be automatically generated from the target host, port, etc. | The name as shown in the Admin Console. | - |
| port | false | 80 | The port Membrane listens on for incoming connections. | 8080 |
Child Structure
| Element | Cardinality | Description |
|---|---|---|
| flow | 0..* | |
| path | 0..1 | If set, Membrane will only consider this rule, if the path of incoming HTTP requests matches. {@link Path} supports starts-with and regex matching. |
| ssl | 0..1 | Configures inbound or outbound SSL connections. |
| target | 0..1 | The destination where the service proxy will send messages to. Use the target element if you want to send the messages to a target. Supports dynamic destinations through expressions. |