Hi,

Willy Tarreau <[email protected]> wrote:
> Hi Maik,
> 
> On Fri, Apr 17, 2009 at 04:29:11AM +0200, Maik Broemme wrote:
> > Hi,
> > 
> > attached is a patch which adds a new option to HAProxy called 'inject'
> > for the mode 'tcp'. In the current version of this patch you can only
> > add data at the beginning of the session. I think this is very useful -
> > at least for me it is. :))
> 
> There are interesting concepts here it seems, eventhough some parts still
> seem a bit confusing to me. I'll review that in depth this week-end. Could
> you give us a few hints about what type of real-world usage you make of
> such a feature ? I certainly can understand the ability to insert a client's
> IP in TCP data, but I'm not sure what purpose returning data to the client
> will serve.
> 

Well i can give you small example for what it would be useful (I haven't
any better example yet. :))

  - Client -> HAProxy

    >> EHLO localhost.localdomain

  - HAProxy -> Server

    >> EHLO localhost.localdomain

  - Server -> HAProxy

    << 250-mydomain.de Hello localhost.localdomain [127.0.0.1]
    << 250-SIZE 52428800
    << 250-PIPELINING
    << 250-AUTH PLAIN LOGIN

  - HAProxy -> Client

    << 250-mydomain.de Hello localhost.localdomain [127.0.0.1]
    << 250-SIZE 13107200
    << 250-AUTH PLAIN

Well I don't want to write a full content inspection based on every
protocol, but in general you could do some small rewrites with it and
change or capabilities of services to match clients capabilities.

> Also, I don't think this should be set as an "option". Options tend to be
> just flags, eventhough some of them are slightly more. Once we figure out
> a more general usage, we will probably find a new keyword family for such
> a feature ;-)
> 

I thought the same at least this is very unbeautiful:

  if (!strcmp(args[2], "req")) {
          curproxy->listen->analysers |= AN_REQ_INJECT;
  } else if (!strcmp(args[2], "rsp")) {

Well I also have a version of the patch which adds it as a mode 'inject'
and add two new files src/proto_inject.c and include/proto/proto_inject.h
What do you think about it?

> Regards,
> Willy
> 

--Maik

Reply via email to