diff --git a/src/Network/WebSockets/Client.hs b/src/Network/WebSockets/Client.hs
--- a/src/Network/WebSockets/Client.hs
+++ b/src/Network/WebSockets/Client.hs
@@ -37,7 +37,7 @@
   , WS.ConnectionException (..)
 
     -- ** Utilities
-  , WS.forkPingThread
+  , WS.withPingThread
   ) where
 
 
diff --git a/test/Network/WebSockets/ClientSpec.hs b/test/Network/WebSockets/ClientSpec.hs
--- a/test/Network/WebSockets/ClientSpec.hs
+++ b/test/Network/WebSockets/ClientSpec.hs
@@ -1,9 +1,11 @@
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE OverloadedStrings #-}
 
 module Network.WebSockets.ClientSpec
-  ( main
-  , spec
-  ) where
+    ( main
+    , spec
+    )
+where
 
 
 import           Control.Applicative        (empty, (<|>))
@@ -14,7 +16,7 @@
 import           Test.Hspec
 import           Text.Read                  (readMaybe)
 
-import qualified Network.WebSockets.Client as WS
+import qualified Network.WebSockets.Client  as WS
 
 
 -- `main` is here so that this module can be run from GHCi on its own.  It is
@@ -26,30 +28,35 @@
 newtype PortNumber = PortNumber Int deriving (Eq, Show)
 
 instance FromEnv PortNumber where
+#if MIN_VERSION_envy(2, 0, 0)
+  fromEnv _ = do
+#else
   fromEnv = do
+#endif
     mpn <- (readMaybe <$> env "WSS_CLIENT_TEST_SERVER_PORT") <|> pure (Just 8614)
     PortNumber <$> maybe empty pure mpn
 
 
 spec :: Spec
 spec = describe "withConnection" $ do
-  Right (PortNumber pn) <- runIO decodeEnv
+    PortNumber pn <- runIO $ either fail return =<< decodeEnv
 
-  let host = "localhost"
-  server <- runIO $ Skews.start $ Skews.Args host pn
+    let host = "localhost"
+    server <- runIO $ Skews.start $ Skews.Args host pn
 
-  let withConnection = WS.withConnection ("ws://" ++ host ++ ":" ++ show pn)
-      payload = "response"
-      response = WS.DataMessage False False False (WS.Binary payload)
-      beforeAction = do
-        Skews.reinit server
-        Skews.setDefaultResponse server payload
+    let withConnection = WS.withConnection ("ws://" ++ host ++ ":" ++ show pn)
+        payload        = "response"
+        response       = WS.DataMessage False False False (WS.Binary payload)
+        beforeAction   = do
+            Skews.reinit server
+            Skews.setDefaultResponse server payload
 
-  before_ beforeAction $
-    it "can send and receive messages via the connection" $ do
-      actualResponse <- withConnection $ \conn -> do
-        WS.sendTextData conn ("client data" :: T.Text)
-        r <- WS.receive conn
-        WS.sendClose conn ("Bye" :: BS.ByteString)
-        return r
-      actualResponse `shouldBe` response
+    before_ beforeAction
+        $ it "can send and receive messages via the connection"
+        $ do
+              actualResponse <- withConnection $ \conn -> do
+                  WS.sendTextData conn ("client data" :: T.Text)
+                  r <- WS.receive conn
+                  WS.sendClose conn ("Bye" :: BS.ByteString)
+                  return r
+              actualResponse `shouldBe` response
diff --git a/wss-client.cabal b/wss-client.cabal
--- a/wss-client.cabal
+++ b/wss-client.cabal
@@ -1,13 +1,12 @@
 name:                wss-client
-version:             0.2.1.1
+version:             0.3.0.0
 synopsis:            A-little-higher-level WebSocket client.
 description:         A-little-higher-level WebSocket client. Based on http-client and http-client-tls.
-homepage:            https://github.com/iij-ii/wss-client
+homepage:            https://github.com/iij-ii/direct-hs/tree/master/wss-client
 license:             BSD3
 license-file:        LICENSE
 author:              Yuji Yamamoto
 maintainer:          yuji-yamamoto@iij.ad.jp
-copyright:           2018 Yuji Yamamoto
 category:            Network
 build-type:          Simple
 extra-source-files:  README.md
@@ -26,7 +25,7 @@
                      , http-client >= 0.5.13
                      , http-client-tls
                      , network-uri
-                     , websockets >= 0.12.0 && < 0.13
+                     , websockets >= 0.12.6 && < 0.13
   default-language:    Haskell2010
 
 executable wss-client-sample
@@ -59,4 +58,4 @@
 
 source-repository head
   type:     git
-  location: https://github.com/iij-ii/wss-client
+  location: https://github.com/iij-ii/direct-hs
