Dynamic parsing and adaptation

Asked by snjesko on 2015-01-04

Hi all,

I'm trying to set up eCAP server with Squid for my research task which is related to dynamic content analysis but I have some difficulties. As for my research, there is a two parts: dynamic analyzis and adaptation "on the fly", and post analysis based on the content saved in cache. I'm not clear how to achieve first goal, so I googled for anything that could possible be useful but without success. So my question is:

- Is it possible to use/interface eCAP server with an HTML parser like Nokogiri and/or JS parser like Google V8 so the code can be analyzed and modified depending on the content? If yes, I ask will someone kindly suggest how to start with this? If no, I'm kindly asking you to suggest me what to do, where to start?

Thanks in advance for your time and effort to look into my problem.

Kind regards,
Snjesko

Question information

Language:
English Edit question
Status:
Answered
For:
eCAP Edit question
Assignee:
No assignee Edit question
Last query:
2015-01-04
Last reply:
2015-01-09
Alex Rousskov (rousskov) said : #1

It is possible to analyze and modify HTTP message headers and bodies. Many (but not all) HTTP message bodies contain HTML.

To analyze and modify messages using eCAP, you need to write a C++ adapter. The e-cap.org site contains brief instructions on how to do that and adapter samples. If message body modification is your goal, you may use the modifying adapter sample as a starting point. Get that sample adapter working before trying to write your own.

You may use any parser to parse body content as long as that parser can be integrated with your adapter code.

Alex Rousskov (rousskov) said : #3

If you need more complex examples, the eCAP ClamAV adapter is quite complex. However, if you do not yet know the difference between ICAP and eCAP, I doubt that more complex adapter examples would help! For comparison among different content adaptation (including inspection) methods, I recommend reading http://wiki.squid-cache.org/SquidFaq/ContentAdaptation

Can you help with this problem?

Provide an answer of your own, or ask snjesko for more information if necessary.

To post a message you must log in.