Skip to content

A peer-to-peer stack for code collaboration

Do not use a hardcoded IPFS API URL in subsribe method. (#509)

James Haydon8305116acb01
diff --git a/src/Radicle/Ipfs.hs b/src/Radicle/Ipfs.hs
index ff4b11f..bb283c8 100644
--- a/src/Radicle/Ipfs.hs
+++ b/src/Radicle/Ipfs.hs
@@ -188,7 +188,8 @@ instance FromJSON PubsubMessage where
subscribe :: Text -> (PubsubMessage -> IO ()) -> IO ()
subscribe topic messageHandler = runResourceT $ do
mgr <- liftIO $ HTTP.newManager HTTP.defaultManagerSettings
- req <- HTTP.parseRequest "http://localhost:9301/api/v0/pubsub/sub" <&>
+ url <- liftIO $ ipfsApiUrl "pubsub/sub"
+ req <- HTTP.parseRequest (toS url) <&>
HTTP.setQueryString
[ ("arg", Just $ T.encodeUtf8 topic)
, ("encoding", Just "json")