Hi,

On Tue, 2021-01-26 at 15:55 +0100, Alexander Rossow wrote:
> Im currently using HAProxy as a http proxy infront of another http
> superproxy. HAProxy is used for authentication and then changes the Proxy
> credentials to those of the superproxy. However, we need to keep track of
> the data usage for each user. Since the superproxy is not made from our
> end, we cannot influence it at all and it ignores any "Connection: Close"
> headers. Therefore if a client uses our proxy (haproxy) and the client
> does not close the socket, the socket can stay open for multiple minutes.
> During this time we will not be able to account for the usage as the usage
> is only logged once the socket is closed. This then leads to the user
> being able to use our service for a greatly longer duration that he/she is
> supposed to. This is why theres 2 solutions I can think of.

Have thought about using stick-tables to track clients/users:
https://cbonte.github.io/haproxy-dconv/2.2/configuration.html#stick-table

-Jarno

> Solution A)
> A way that haproxy logs frequently during the entire socket duration so we
> can then reload haproxy to close all sockets once a user runs out of data
> to use.
> 
> Solution B)
> A way to use LUA during the actual tunneling (after the HTTP tunnel is
> established) so that we can reauthenticate users and log the usage
> ourselves.
> 
> Am Di., 26. Jan. 2021 um 15:12 Uhr schrieb Jarno Huuskonen <
> [email protected]>:
> > Hi,
> > 
> > On Tue, 2021-01-26 at 14:32 +0100, Alexander Rossow wrote:
> > > Hi there,
> > > I would like to know if it is possible to update the logs while the
> > socket
> > > is open. Currently the logs are updated only after closing the socket,
> > > which causes issues. We have already tried the http close and the
> > https
> > > close server options. Unfortunately without success
> > > Thanks in advance
> > > 
> > 
> > option logasap ?
> > (
> > https://cbonte.github.io/haproxy-dconv/2.2/configuration.html#4.2-option%20logasap
> > )

-- 
Jarno Huuskonen

Reply via email to