Komodia's Redirector ad injection guide

From Komodia
Jump to: navigation, search

Which framework to use for ad injection

There are number of ways to do ad injection, they vary in flexibility and speed:

Requires C++ programmer

  1. Integrate inside the source code, there's no speed change, code lives inside the context of the proxy and requires source code (Contact Komodia on how to do this).
  2. Using the Komodia's Redirector DLL framework guide, there's no speed change, code lives inside the context of the proxy and requires does not require source code, samples are inside the DLL samples zip:
    1. PCProxyDLL - Inject javascript with ad injector.
    2. PCProxyDLL - Inject javascript with HTTP Parser.

Doesn't require C++ programmer

These methods can be used from any COM supporting language (.NET, Delphi):

  1. Using the internal ad injector, there's no speed change, code lives inside the context of the proxy and is set once via the COM API, the internal injector can't be used for complex logic, it only injects one javascript inside a whitelist/blacklist of domains Sample is under Ad injection with internal injector (contact Komodia for other languages).
  2. Using the Komodia's Redirector COM framework guide, there's a speed change because of COM communicating between processes, code lives inside the context of the client's app and doesn't requires does not require source code, samples are under:
    1. C++\Direct\Ad inject with HTTP Parser.
    2. C++\Direct\Ad inject with ad injector.
    3. C++\Direct\Ad injection (using service instead of console).
    4. C#\JS Injection.

Difference between injecting with HTTP Parser, and injecting with ad injection module

  • The HTTP Parser is holding the entire page before it injects the data, it should be used if the JS is injected after the body or the page data needs to be inspected.
  • The Ad Injector module is able to inject into a page without waiting for the complete data (except for chunked encoding, in which it falls back automatically to the HTTP Parser), it should be used if the JS is injected inside the header or before the body, and the data doesn't need to be inspected.