From 08a774cab165c9291e3be1d81b1f5d72d44c5d7b Mon Sep 17 00:00:00 2001 From: Travis Whitaker Date: Fri, 27 Dec 2024 14:45:15 -0500 Subject: [PATCH 1/2] Bind ipv4 addr to keep test from opening ipv6 sock --- grapesy/test-grapesy/Test/Regression/Issue238.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grapesy/test-grapesy/Test/Regression/Issue238.hs b/grapesy/test-grapesy/Test/Regression/Issue238.hs index 7f5eecc..b4358a5 100644 --- a/grapesy/test-grapesy/Test/Regression/Issue238.hs +++ b/grapesy/test-grapesy/Test/Regression/Issue238.hs @@ -189,7 +189,7 @@ testWith handlers client = do where serverConfig :: Server.ServerConfig serverConfig = Server.ServerConfig { - serverInsecure = Just $ Server.InsecureConfig Nothing 0 + serverInsecure = Just $ Server.InsecureConfig (Just "127.0.0.1") 0 , serverSecure = Nothing } From 868c3372301d4ebc9b98e8e6f53555dbea5b7b3f Mon Sep 17 00:00:00 2001 From: Travis Whitaker Date: Fri, 27 Dec 2024 15:35:55 -0500 Subject: [PATCH 2/2] Explicitly bind 0.0.0.0 so tutorial servers work on MacOS --- tutorials/basics/app/Server.hs | 2 +- tutorials/lowlevel/app/Server.hs | 2 +- tutorials/metadata/app/Server.hs | 2 +- tutorials/monadstack/app/Server.hs | 2 +- tutorials/quickstart/app/Server.hs | 2 +- tutorials/trailers-only/app/Server.hs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tutorials/basics/app/Server.hs b/tutorials/basics/app/Server.hs index c699586..b549740 100644 --- a/tutorials/basics/app/Server.hs +++ b/tutorials/basics/app/Server.hs @@ -76,6 +76,6 @@ main = do where config :: ServerConfig config = ServerConfig { - serverInsecure = Just (InsecureConfig Nothing defaultInsecurePort) + serverInsecure = Just (InsecureConfig (Just "0.0.0.0") defaultInsecurePort) , serverSecure = Nothing } diff --git a/tutorials/lowlevel/app/Server.hs b/tutorials/lowlevel/app/Server.hs index 6d3a3bb..ab72e9d 100644 --- a/tutorials/lowlevel/app/Server.hs +++ b/tutorials/lowlevel/app/Server.hs @@ -85,6 +85,6 @@ main = do where config :: ServerConfig config = ServerConfig { - serverInsecure = Just (InsecureConfig Nothing defaultInsecurePort) + serverInsecure = Just (InsecureConfig (Just "0.0.0.0") defaultInsecurePort) , serverSecure = Nothing } diff --git a/tutorials/metadata/app/Server.hs b/tutorials/metadata/app/Server.hs index 71f0b1e..5aa4ac4 100644 --- a/tutorials/metadata/app/Server.hs +++ b/tutorials/metadata/app/Server.hs @@ -68,6 +68,6 @@ main = where config :: ServerConfig config = ServerConfig { - serverInsecure = Just (InsecureConfig Nothing defaultInsecurePort) + serverInsecure = Just (InsecureConfig (Just "0.0.0.0") defaultInsecurePort) , serverSecure = Nothing } diff --git a/tutorials/monadstack/app/Server.hs b/tutorials/monadstack/app/Server.hs index 5eca1d4..433647d 100644 --- a/tutorials/monadstack/app/Server.hs +++ b/tutorials/monadstack/app/Server.hs @@ -95,6 +95,6 @@ main = do where config :: ServerConfig config = ServerConfig { - serverInsecure = Just (InsecureConfig Nothing defaultInsecurePort) + serverInsecure = Just (InsecureConfig (Just "0.0.0.0") defaultInsecurePort) , serverSecure = Nothing } diff --git a/tutorials/quickstart/app/Server.hs b/tutorials/quickstart/app/Server.hs index b63deab..79b7fff 100644 --- a/tutorials/quickstart/app/Server.hs +++ b/tutorials/quickstart/app/Server.hs @@ -32,6 +32,6 @@ main = where config :: ServerConfig config = ServerConfig { - serverInsecure = Just (InsecureConfig Nothing defaultInsecurePort) + serverInsecure = Just (InsecureConfig (Just "0.0.0.0") defaultInsecurePort) , serverSecure = Nothing } diff --git a/tutorials/trailers-only/app/Server.hs b/tutorials/trailers-only/app/Server.hs index aef8439..87e50aa 100644 --- a/tutorials/trailers-only/app/Server.hs +++ b/tutorials/trailers-only/app/Server.hs @@ -77,6 +77,6 @@ main = do where config :: ServerConfig config = ServerConfig { - serverInsecure = Just (InsecureConfig Nothing defaultInsecurePort) + serverInsecure = Just (InsecureConfig (Just "0.0.0.0") defaultInsecurePort) , serverSecure = Nothing }