# How do you connect to a specific peer?

**URL:** <https://discuss.ipfs.tech/t/how-do-you-connect-to-a-specific-peer/3122>\
**Category:** Help\
**Created:** [June 5, 2018, 4:36pm UTC](https://discuss.ipfs.tech/t/how-do-you-connect-to-a-specific-peer/3122 "2018-06-05T16:36:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertheessels](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/robertheessels/32/2462_2.png) [@robertheessels](https://discuss.ipfs.tech/u/robertheessels)\
**Post date:** [June 5, 2018, 4:36pm UTC](https://discuss.ipfs.tech/t/how-do-you-connect-to-a-specific-peer/3122/1 "2018-06-05T16:36:51Z")

</div>

I have my IPFS server set up and running and it is connected to other peers. I have the IP and the IPFS ‘id’.

In my browser app I use js-ipfs and want to connect directly to my server. How can I do that?

---

<div class="post-metadata">

**Author:** ![robertheessels](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/robertheessels/32/2462_2.png) [@robertheessels](https://discuss.ipfs.tech/u/robertheessels)\
**Post date:** [June 5, 2018, 5:17pm UTC](https://discuss.ipfs.tech/t/how-do-you-connect-to-a-specific-peer/3122/2 "2018-06-05T17:17:55Z")

</div>

I tried `ipfs.swarm.connect('/ip4/149.28.../tcp/4001/ipfs/Qm...')` but get error:

`connect Error: Circuit not enabled!`

(It works when I do it at the command line of another peer.)

---

<div class="post-metadata">

**Author:** ![lidel](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/lidel/32/9853_2.png) [@lidel](https://discuss.ipfs.tech/u/lidel)\
**Post date:** [June 5, 2018, 7:09pm UTC](https://discuss.ipfs.tech/t/how-do-you-connect-to-a-specific-peer/3122/3 "2018-06-05T19:09:34Z")

</div>

In short, js-ipfs running in browser context has a limited number of transports and raw TCP socket exposed by go-ipfs node is not reachable by any of them.

If you control the go-ipfs node you want to connect to, then you could make it listen on additional websocket (`/ws`) port, for example:

```json
"Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip4/0.0.0.0/tcp/4004/ws",
      "/ip6/::/tcp/4001"
    ]

```

That way js-ipfs running in browser will be able to dial your server over websocket transport.

ps. FYI there is an ongoing work to provide automatic relay feature for nodes with limited transport options, such as ones in web browsers. For now we have semi-manual solution (eg. there is no relay discovery, you need to hardcode it in config etc). More details and current status: [Tutorial - Understanding Circuit Relay](https://github.com/ipfs/js-ipfs/tree/master/examples/circuit-relaying)

---

<div class="post-metadata">

**Author:** ![robertheessels](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/robertheessels/32/2462_2.png) [@robertheessels](https://discuss.ipfs.tech/u/robertheessels)\
**Post date:** [June 5, 2018, 9:28pm UTC](https://discuss.ipfs.tech/t/how-do-you-connect-to-a-specific-peer/3122/4 "2018-06-05T21:28:12Z")

</div>

Thank you!

In the end I was able to connect though wss via a Nginx proxy.
