diff --git a/cbits/byteorder.c b/cbits/byteorder.c
--- a/cbits/byteorder.c
+++ b/cbits/byteorder.c
@@ -2,7 +2,12 @@
    implemented as macros only, so I have to re-export functions here to do the
    conversions. */
 
-#include <arpa/inet.h>
+#if defined(WINDOWS)
+#  include <winsock2.h>
+#  include <inttypes.h>
+#else
+#  include <arpa/inet.h>
+#endif
 
 uint32_t iostreams_htonl(uint32_t hostlong) {
     return htonl(hostlong);
diff --git a/io-streams-haproxy.cabal b/io-streams-haproxy.cabal
--- a/io-streams-haproxy.cabal
+++ b/io-streams-haproxy.cabal
@@ -1,5 +1,5 @@
 name:                io-streams-haproxy
-version:             1.0.0.0
+version:             1.0.0.1
 synopsis:            HAProxy protocol 1.5 support for io-streams
 
 description: HAProxy protocol version 1.5 support (see
@@ -35,7 +35,7 @@
   other-modules:     System.IO.Streams.Network.Internal.Address
   c-sources:         cbits/byteorder.c
 
-  build-depends:     base              >= 4.4 && < 4.10,
+  build-depends:     base              >= 4.5 && < 4.10,
                      attoparsec        >= 0.7 && < 0.14,
                      bytestring        >= 0.9 && < 0.11,
                      io-streams        >= 1.3 && < 1.4,
@@ -45,6 +45,9 @@
 
   ghc-options:       -Wall -fwarn-tabs -funbox-strict-fields
                      -fno-warn-unused-do-bind
+  if os(windows)
+    cpp-options:     -DWINDOWS
+    cc-options:      -DWINDOWS
 
 test-suite testsuite
   type:              exitcode-stdio-1.0
@@ -70,3 +73,6 @@
                      HUnit                      >= 1.2      && <2,
                      test-framework             >= 0.8.0.3  && <0.9,
                      test-framework-hunit       >= 0.2.7    && <0.4
+  if os(windows)
+    cpp-options:     -DWINDOWS
+    cc-options:      -DWINDOWS
