diff --git a/Network/URI/Conduit.hs b/Network/URI/Conduit.hs
--- a/Network/URI/Conduit.hs
+++ b/Network/URI/Conduit.hs
@@ -2,6 +2,7 @@
 {-# LANGUAGE DeriveDataTypeable #-}
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE CPP #-}
 module Network.URI.Conduit
     ( -- * Base datatypes
       URI (..)
@@ -140,7 +141,11 @@
         }
 
 relativeTo :: URI -> URI -> Maybe URI
+#if MIN_VERSION_network(2,4,0)
+relativeTo a b = Just $ fromNetworkURI $ toNetworkURI a `N.relativeTo` toNetworkURI b
+#else
 relativeTo a b = fmap fromNetworkURI $ toNetworkURI a `N.relativeTo` toNetworkURI b
+#endif
 
 nullURI :: URI
 nullURI = fromNetworkURI N.nullURI
diff --git a/uri-conduit.cabal b/uri-conduit.cabal
--- a/uri-conduit.cabal
+++ b/uri-conduit.cabal
@@ -1,5 +1,5 @@
 Name:                uri-conduit
-Version:             0.5.0.1
+Version:             0.5.0.2
 Synopsis:            Read and write URIs
 Homepage:            http://github.com/snoyberg/xml
 License:             BSD3
@@ -19,7 +19,7 @@
                      , text                     >= 0.5        && < 1.0
                      , transformers             >= 0.2        && < 0.4
                      , bytestring               >= 0.9
-                     , network                  >= 2.2        && < 2.4
+                     , network                  >= 2.2
                      , containers               >= 0.2
                      , failure                  >= 0.1        && < 0.3
                      , monad-control            >= 0.3        && < 0.4
