diff options
author | Kazu Yamamoto <kazu@iij.ad.jp> | 2012-10-17 10:29:33 +0900 |
---|---|---|
committer | Kazu Yamamoto <kazu@iij.ad.jp> | 2012-10-17 10:29:33 +0900 |
commit | 71aae4e574861131c8f1d661513d1d4de40dfafc (patch) | |
tree | 32a2eee0b9a28615a6e8e50ba6f3930c03d0dbb7 | |
parent | 3e364247caed8c0bbe0e81531473b6c6b86506c4 (diff) |
adding "." to "localhost" and using "8.8.8.8".
The last dot is suggested by Ben Clifford <benc>.
-rw-r--r-- | SimpleServer.hs | 6 |
1 files 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) |