aboutsummaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-06-23 21:03:29 +0000
committerOmar Polo <op@omarpolo.com>2023-06-23 21:03:29 +0000
commit509d0509a50883a6f8407b63774f40dd1e41dadf (patch)
treeea2389673345057be53bccbcf653fb0435d77259 /regress
parent37df23d183de23b74f8a026977b8210dc22701a6 (diff)
implement `listen on'
Listening by default on all the addresses is so bad I don't know why I haven't changed this before. Anyway. Add a `listen on $hostname port $port' syntax to the config file and deprecate the old "port" and "ipv6" global setting. Still try to honour them when no "listen on" directive is used for backward compatibily, but this will go away in the next next version hopefully. At the moment the `listen on' in server context don't filter the host, i.e. one can still reach a host from a address not specified in the corresponding `liste on', this will be added later.
Diffstat (limited to 'regress')
-rw-r--r--regress/lib.sh6
-rw-r--r--regress/tests.sh2
2 files changed, 4 insertions, 4 deletions
diff --git a/regress/lib.sh b/regress/lib.sh
index c61285b..06cb7a7 100644
--- a/regress/lib.sh
+++ b/regress/lib.sh
@@ -10,9 +10,7 @@ current_test=
run_test() {
ggflags=
port=10965
- config_common="ipv6 off
-port $port
-"
+ config_common=""
hdr=
body=
dont_check_server_alive=no
@@ -64,6 +62,7 @@ server "localhost" {
cert "$PWD/cert.pem"
key "$PWD/key.pem"
root "$PWD/testdata"
+ listen on localhost port $port
$2
}
EOF
@@ -78,6 +77,7 @@ set_proxy() {
server "localhost.local" {
cert "$PWD/cert.pem"
key "$PWD/key.pem"
+ listen on localhost port $port
proxy {
relay-to localhost port $port
$1
diff --git a/regress/tests.sh b/regress/tests.sh
index 5ebc33b..a38e4ba 100644
--- a/regress/tests.sh
+++ b/regress/tests.sh
@@ -239,13 +239,13 @@ test_fastcgi() {
test_macro_expansion() {
cat <<EOF > reg.conf
pwd = "$PWD"
-$config_common
server "localhost" {
# the quoting of \$ is for sh
cert \$pwd "/cert.pem"
key \$pwd "/key.pem"
root \$pwd "/testdata"
+ listen on localhost port $port
}
EOF