diff --git a/CHANGELOG b/CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+- 0.9.4.0
+    * Add `makePendingConnectionFromStream` function
+    * Bump `attoparsec` dependency
+
 - 0.9.3.1
     * Bump `QuickCheck` dependency
 
diff --git a/src/Network/WebSockets.hs b/src/Network/WebSockets.hs
--- a/src/Network/WebSockets.hs
+++ b/src/Network/WebSockets.hs
@@ -53,6 +53,7 @@
       -- * Utilities for writing your own server
     , makeListenSocket
     , makePendingConnection
+    , makePendingConnectionFromStream
 
       -- * Running a client
     , ClientApp
diff --git a/src/Network/WebSockets/Server.hs b/src/Network/WebSockets/Server.hs
--- a/src/Network/WebSockets/Server.hs
+++ b/src/Network/WebSockets/Server.hs
@@ -9,6 +9,7 @@
     , runServerWith
     , makeListenSocket
     , makePendingConnection
+    , makePendingConnectionFromStream
     ) where
 
 
@@ -92,8 +93,15 @@
 -- | Turns a socket, connected to some client, into a 'PendingConnection'.
 makePendingConnection
     :: Socket -> ConnectionOptions -> IO PendingConnection
-makePendingConnection sock opts = do
-    stream   <- Stream.makeSocketStream sock
+makePendingConnection socket opts = do
+    stream  <- Stream.makeSocketStream socket
+    makePendingConnectionFromStream stream opts
+
+-- | More general version of 'makePendingConnection' for 'Stream.Stream'
+-- instead of a 'Socket'.
+makePendingConnectionFromStream
+    :: Stream.Stream -> ConnectionOptions -> IO PendingConnection
+makePendingConnectionFromStream stream opts = do
     -- TODO: we probably want to send a 40x if the request is bad?
     mbRequest <- Stream.parse stream (decodeRequestHead False)
     case mbRequest of
diff --git a/websockets.cabal b/websockets.cabal
--- a/websockets.cabal
+++ b/websockets.cabal
@@ -1,5 +1,5 @@
 Name:    websockets
-Version: 0.9.3.1
+Version: 0.9.4.0
 
 Synopsis:
   A sensible and clean way to write WebSocket-capable servers in Haskell.
@@ -64,7 +64,7 @@
     Network.WebSockets.Types
 
   Build-depends:
-    attoparsec        >= 0.10   && < 0.13,
+    attoparsec        >= 0.10   && < 0.14,
     base              >= 4      && < 5,
     base64-bytestring >= 0.1    && < 1.1,
     binary            >= 0.5    && < 0.8,
@@ -99,7 +99,7 @@
     test-framework-hunit       >= 0.2 && < 0.4,
     test-framework-quickcheck2 >= 0.2 && < 0.4,
     -- Copied from regular dependencies...
-    attoparsec        >= 0.10   && < 0.13,
+    attoparsec        >= 0.10   && < 0.14,
     base              >= 4      && < 5,
     base64-bytestring >= 0.1    && < 1.1,
     binary            >= 0.5    && < 0.8,
