HAProxy supports 4 connection modes :
- keep alive : all requests and responses are processed (default)
- tunnel : only the first request and response are processed,
- everything else is forwarded with no analysis.
+ everything else is forwarded with no analysis (deprecated).
- server close : the server-facing connection is closed after the response.
- close : the connection is actively closed after end of response.
- TUN: tunnel ("option http-tunnel") : this was the default mode for versions
1.0 to 1.5-dev21 : only the first request and response are processed, and
everything else is forwarded with no analysis at all. This mode should not
- be used as it creates lots of trouble with logging and HTTP processing. It
- is supported only on frontends.
+ be used as it creates lots of trouble with logging and HTTP processing.
+ And because it cannot work in HTTP/2, this option is deprecated and it is
+ only supported on legacy HTTP frontends. In HTX, it is ignored and a
+ warning is emitted during HAProxy startup.
- SCL: server close ("option http-server-close") : the server-facing
connection is closed after the end of the response is received, but the
option http-no-delay (*) X X X X
option http-pretend-keepalive (*) X - X X
option http-server-close (*) X X X X
-option http-tunnel (*) X X X -
+option http-tunnel (deprecated) (*) X X X -
option http-use-proxy-header (*) X X X -
option http-use-htx (*) X X X X
option httpchk X - X X
"option http-keep-alive", and "1.1. The HTTP transaction model".
-option http-tunnel
-no option http-tunnel
- Disable or enable HTTP connection processing after first transaction
+option http-tunnel (deprecated)
+no option http-tunnel (deprecated)
+ Disable or enable HTTP connection processing after first transaction.
May be used in sections : defaults | frontend | listen | backend
yes | yes | yes | no
Arguments : none
+ Warning : Because it cannot work in HTTP/2, this option is deprecated and it
+ is only supported on legacy HTTP frontends. In HTX, it is ignored and a
+ warning is emitted during HAProxy startup.
+
By default HAProxy operates in keep-alive mode with regards to persistent
connections: for each connection it processes each request and response, and
leaves the connection idle on both sides between the end of a response and
newsrv->mux_proto = mux_ent;
}
+ /* the option "http-tunnel" is ignored when HTX is enabled and
+ * only works with the legacy HTTP. So emit a warning if the
+ * option is set on a HTX frontend. */
+ if ((curproxy->cap & PR_CAP_FE) && curproxy->options2 & PR_O2_USE_HTX &&
+ (curproxy->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN) {
+ ha_warning("config : %s '%s' : the option 'http-tunnel' is ignored for HTX proxies.\n",
+ proxy_type_str(curproxy), curproxy->id);
+ curproxy->options &= ~PR_O_HTTP_MODE;
+ }
+
/* initialize idle conns lists */
for (newsrv = curproxy->srv; newsrv; newsrv = newsrv->next) {
int i;
struct proxy *fe = h1s->h1c->px;
int flag = H1S_F_WANT_KAL; /* For client connection: server-close == keepalive */
- /* Tunnel mode can only by set on the frontend */
- if ((fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN)
- flag = H1S_F_WANT_TUN;
- else if ((fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_CLO)
+ if ((fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_CLO)
flag = H1S_F_WANT_CLO;
/* flags order: CLO > SCL > TUN > KAL */
int flag = H1S_F_WANT_KAL;
int fe_flags = sess ? sess->fe->options : 0;
- /* Tunnel mode can only by set on the frontend */
- if ((fe_flags & PR_O_HTTP_MODE) == PR_O_HTTP_TUN)
- flag = H1S_F_WANT_TUN;
-
/* For the server connection: server-close == httpclose */
if ((fe_flags & PR_O_HTTP_MODE) == PR_O_HTTP_SCL ||
(be->options & PR_O_HTTP_MODE) == PR_O_HTTP_SCL ||