# Unable to connect to my private network using ipfs-http-client?

**URL:** <https://discuss.ipfs.tech/t/unable-to-connect-to-my-private-network-using-ipfs-http-client/5519>\
**Category:** js-ipfs\
**Created:** [May 28, 2019, 11:24am UTC](https://discuss.ipfs.tech/t/unable-to-connect-to-my-private-network-using-ipfs-http-client/5519 "2019-05-28T11:24:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AkshitV](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/akshitv/32/2680_2.png) [@AkshitV](https://discuss.ipfs.tech/u/AkshitV)\
**Post date:** [May 28, 2019, 11:24am UTC](https://discuss.ipfs.tech/t/unable-to-connect-to-my-private-network-using-ipfs-http-client/5519/1 "2019-05-28T11:24:18Z")

</div>

[beginner]  
js-ipfs is same as ipfs-http-client right ?  
()[https://www.npmjs.com/package/ipfs-http-client](https://www.npmjs.com/package/ipfs-http-client)  
I have made a private network using my pc and an instance from aws  
i want to add files onto this network, check nodes added in the swarm, etc

Here’s what i have done and what i get

const ipfsClient = require (“ipfs-http-client”)  
//tried these two :  
var ipfs = ipfsClient(’/ip4/35.154.130.223/tcp/4001’)  
//and  
var ipfs = ipfsClient({ host: ‘35.154.130.223’, port: ‘4001’, ‘api-path’: ‘/ipfs/api/v0’ })  
ipfs.swarm.peers((err, peers) =\> {  
console.log("1"err)  
console.log("2"peers)  
})  
ipfs.config.get((err, config) =\> {  
if (err) {  
throw err  
}  
console.log(“consigggggg”,config)  
})

Attaching output  
terminal above shows the network running, and peers added to the swarm  
terminal below shows the output of the code

 ![Screenshot%20from%202019-05-28%2016-55-26](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/5/58e650267fb9b39dca2689ffa2d864608748fe54.png)

---

<div class="post-metadata">

**Author:** ![jasonzhouu](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/jasonzhouu/32/2682_2.png) [@jasonzhouu](https://discuss.ipfs.tech/u/jasonzhouu)\
**Post date:** [May 28, 2019, 2:34pm UTC](https://discuss.ipfs.tech/t/unable-to-connect-to-my-private-network-using-ipfs-http-client/5519/2 "2019-05-28T14:34:44Z")

</div>

> [@AkshitV](#):
>
> js-ipfs is same as ipfs-http-client right ?

`js-ipfs-http-client` is a smaller library than `js-ipfs`

- `js-ipfs` is a full implementation of IPFS
- `js-ipfs-http-client` is a smaller library that controls an IPFS node that is already running via its [HTTP API](https://docs.ipfs.io/reference/api/http/).

(refer to [https://docs.ipfs.io/reference/js/overview/](https://docs.ipfs.io/reference/js/overview/))

* * *

> [@AkshitV](#):
>
> //tried these two :  
> var ipfs = ipfsClient(’/ip4/35.154.130.223/tcp/4001’)  
> //and  
> var ipfs = ipfsClient({ host: ‘35.154.130.223’, port: ‘4001’, ‘api-path’: ‘/ipfs/api/v0’ })

You should run an ipfs daemon locally.  
(refer to [GitHub - ipfs-inactive/js-ipfs-http-client: [ARCHIVED] now part of the https://github.com/ipfs/js-ipfs repo](https://github.com/ipfs/js-ipfs-http-client))

```auto
var ipfsClient = require('ipfs-http-client')

// connect to ipfs daemon API server
var ipfs = ipfsClient('localhost', '5001', { protocol: 'http' }) // leaving out the arguments will default to these values

// or connect with multiaddr
var ipfs = ipfsClient('/ip4/127.0.0.1/tcp/5001')

// or using options
var ipfs = ipfsClient({ host: 'localhost', port: '5001', protocol: 'http' })

// or specifying a specific API path
var ipfs = ipfsClient({ host: '1.1.1.1', port: '80', 'api-path': '/ipfs/api/v0' })

```

---

<div class="post-metadata">

**Author:** ![AkshitV](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/akshitv/32/2680_2.png) [@AkshitV](https://discuss.ipfs.tech/u/AkshitV)\
**Post date:** [May 28, 2019, 2:53pm UTC](https://discuss.ipfs.tech/t/unable-to-connect-to-my-private-network-using-ipfs-http-client/5519/3 "2019-05-28T14:53:13Z")

</div>

Can i not use it with my private network
