# How to connect to ipfs-cluster from js-ipfs browser

**URL:** <https://discuss.ipfs.tech/t/how-to-connect-to-ipfs-cluster-from-js-ipfs-browser/16433>\
**Category:** js-ipfs\
**Tags:** js-ipfs, ipfs-cluster\
**Created:** [May 16, 2023, 10:30am UTC](https://discuss.ipfs.tech/t/how-to-connect-to-ipfs-cluster-from-js-ipfs-browser/16433 "2023-05-16T10:30:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![logesh2496](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/logesh2496/32/7670_2.png) [@logesh2496](https://discuss.ipfs.tech/u/logesh2496)\
**Post date:** [May 16, 2023, 10:30am UTC](https://discuss.ipfs.tech/t/how-to-connect-to-ipfs-cluster-from-js-ipfs-browser/16433/1 "2023-05-16T10:30:22Z")

</div>

I have been trying to connect my js-ipfs node running in browser with ipfs-cluster running in my local. I tried the below code, but getting no valid addresses error.

```auto
await create({
  repo: 'ipfs-' + Math.random(),
  config: {
      Addresses: {
          Swarm: [
            '/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star'
            ]
          }
      },  
    })
// After succesfully connected to a public swarm node, console prints Swarm listening at `url/p2p/mypeerid`
const peerID = peerIdFromString('peerID here'); // import { peerIdFromString } from '@libp2p/peer-id
await ipfs.swarm.connect(peerID); // This throws error

```
