reyk / relayd

OpenBSD relayd daemon -experimental

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

relay http persistent connection

paulfariello opened this issue · comments

I can't have relayd relaying relaying an HTTP persistent connection (Connection: keep-alive) to two differents destination.

I'm using the following configuration:

table <srv1> { 127.0.0.1 }
table <srv2> { 127.0.0.1 }

http protocol "httpfilter" {
    return error
    match url "www.example.org/" forward to <srv1>
    match url "www.example.org/api/" forward to <srv2>
}

relay www {
    listen on 127.0.0.1 port 80
    protocol httpfilter

    forward to <srv1> port 8080 check tcp
    forward to <srv2> port 8181 check tcp
}

Then I test with the following command:

curl http://www.example.org http://www.example.org/api/

And I have the following logs in relayd:

relay www, session 1 (1 active), 0, 127.0.0.1 -> 127.0.0.1:8080, done, GET GET

And in fact, I receive two response from the same destination. The first one (i.e. 127.0.0.1:8080)

This has been fixed in -current