How to redirect a HTTP Stream on the Request Message
I have implement the ability to redirect requests to a single web page. It is not optimal as I would like to redirect as soon as possible.
Currently my adapter is implemented with this work flow:
1) Request is forwarded to ecap adapter
2) Extract the Host header value and store internally as key=>hostName
3) Set the X-Subscriber-Id with the key
4) Allow the request to go unmodified to the destination (useVirgin)
5) Response comes back from destination
6) Extract the X-Subscriber-Id to get the key
7) check to see if the the hostName matches one requiring redirection
8) Create a new message
9) Add the 307 redirect headers
10) Swap out the original response with the adapted on (useAdapted)
This works, but is inefficient as I'm fetching data from the destination that I'm just going to throw away. It also lack the ability to redirect CONNECT requests that don't have responses.
It is possible to intercept the request and satisify the response with out getting the data from the destination server? Something along the lines of?
1) Request is sent to ecap adapter
2) Create a redirect message and set it as the response message.
Where would I start to implement this?
Thanks
Kyle Brost
----
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- eCAP Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Kyle Brost for more information if necessary.