# Unable to connect 2 js-ipfs nodes using webrtc-star in Swarm (but browser does connect)

**URL:** https://discuss.ipfs.tech/t/unable-to-connect-2-js-ipfs-nodes-using-webrtc-star-in-swarm-but-browser-does-connect/13019
**Category:** js-ipfs
**Created:** [December 22, 2021, 10:19pm UTC](https://discuss.ipfs.tech/t/unable-to-connect-2-js-ipfs-nodes-using-webrtc-star-in-swarm-but-browser-does-connect/13019 "2021-12-22T22:19:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dpx](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dpx](https://discuss.ipfs.tech/u/dpx)
#### Post date: [December 22, 2021, 10:19pm UTC](https://discuss.ipfs.tech/t/unable-to-connect-2-js-ipfs-nodes-using-webrtc-star-in-swarm-but-browser-does-connect/13019/1 "2021-12-22T22:19:50Z")

</div>

I’m trying to connect two js-ipfs nodes by connecting both to a libp2p webrtc star exclusively.

Both nodes appear to be connected with the webrtc star, but aren’t connecting with each other.

Only when I open a js-ipfs session in my browser, then it establishes a connection with both nodes (but the nodes don’t seem to connect with each other directly).

Here’s my setup:

1. I created a WebRTC star node by following [these instructions](https://suda.pl/free-webrtc-star-heroku/).

2. I have two separate servers each running the following js-ipfs instance:

```auto
const initIPFSInstance = async () => {
  return await IPFS.create({
    repo: './.ipfs',
    relay: { enabled: true, hop: { enabled: true } },
    EXPERIMENTAL: { pubsub: true },
    config: {
      Addresses: {
        Swarm: [
          "/dns4/my-webrtc-star.herokuapp.com/tcp/443/wss/p2p-webrtc-star/",
        ]
      }
    },
    libp2p: {
      modules: {
        transport: [WebRTCStar]
      },
      config: {
        peerDiscovery: {
          webRTCStar: { 
            enabled: true
          }
        },
        transport: {
          WebRTCStar: { 
            wrtc
          }
        }
      }
    }
  });
};

```

Running the nodes I get:

```auto
Swarm listening on /dns4/my-webrtc-star.herokuapp.com/tcp/443/wss/p2p-webrtc-star/p2p/12D3KooWR5U7wyqFaBexxxxxxxxxxxxxxxxxyunS2pZUPqR3DAbg

```

The nodes never sync with each other directly and only seem to connect to browser clients (that also only connect to the WebRTC star).

How do I fix this?

---

<div class="post-metadata">

### Author: ![dpx](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dpx](https://discuss.ipfs.tech/u/dpx)
#### Post date: [December 22, 2021, 11:18pm UTC](https://discuss.ipfs.tech/t/unable-to-connect-2-js-ipfs-nodes-using-webrtc-star-in-swarm-but-browser-does-connect/13019/2 "2021-12-22T23:18:43Z")

</div>

Fixed . Only needed to add Websockets as a transport and add the websocket IP (`/ip4/0.0.0.0/tcp/4003/ws`) to the nodes’ Swarm list.

---

<div class="post-metadata">

### Author: ![LucaPanofsky](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/lucapanofsky/32/4868_2.png) [@LucaPanofsky](https://discuss.ipfs.tech/u/LucaPanofsky)
#### Post date: [December 23, 2021, 11:49pm UTC](https://discuss.ipfs.tech/t/unable-to-connect-2-js-ipfs-nodes-using-webrtc-star-in-swarm-but-browser-does-connect/13019/3 "2021-12-23T23:49:56Z")

</div>

I think that the js-ipfs nodes cannot communicate between each other over the webrtc without browser nodes with circuit relay enabled

When you open your brower session indeed you should see your two nodes communicating over the relay node

(that is my understanding)
