From 71aae4e574861131c8f1d661513d1d4de40dfafc Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Wed, 17 Oct 2012 10:29:33 +0900 Subject: adding "." to "localhost" and using "8.8.8.8". The last dot is suggested by Ben Clifford . --- SimpleServer.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SimpleServer.hs b/SimpleServer.hs index 6cd1c11..fe29613 100644 --- a/SimpleServer.hs +++ b/SimpleServer.hs @@ -27,8 +27,8 @@ instance Default Conf where def = Conf { bufSize = 512 , timeOut = 3 * 1000 * 1000 - , realDNS = "192.168.1.1" - , hosts = [("localhost", "127.0.0.1")] + , realDNS = "8.8.8.8" + , hosts = [("localhost.", "127.0.0.1")] } timeout' :: String -> Int -> IO a -> IO (Maybe a) @@ -42,7 +42,7 @@ proxyRequest Conf{..} rc req = do let worker Resolver{..} = do let packet = mconcat . toChunks $ encode req sendAll dnsSock packet - receive dnsSock dnsBufsize + receive dnsSock rs <- makeResolvSeed rc withResolver rs $ \r -> (>>= check) <$> timeout' "proxy timeout" timeOut (worker r) -- cgit v1.2.3