Hi, I’m trying to access my ipfs node (created with js-ipfs in nodejs) over http API (in the aim of using js-ipfs-cluster), but everytime I tried I got a connection refused error.
node : 12.9.1.
Js-ipfs version : 0.50.2.
After reading some post about it I tried to allow CORS request but nothing changed.
const ipfsNode = await IPFS.create({
repo: './jsipfs',
config: {
Addresses: {
Swarm: [
'/ip4/0.0.0.0/tcp/4012',
'/ip4/127.0.0.1/tcp/4013/ws'
],
API: '/ip4/127.0.0.1/tcp/5001',
Gateway: '/ip4/127.0.0.1/tcp/9191'
}
}
})
const key1 = 'API.HTTPHeaders.Access-Control-Allow-Origin'
const val1 = ['*']
ipfsNode.config.set(key1, val1)
const key2 = 'API.HTTPHeaders.Access-Control-Allow-Methods'
const val2 = ["PUT", "POST", "GET"]
ipfsNode.config.set(key2, val2)
I’m using postman to do the http request (which works well if a download ipfs cli for windows).
Any idea about what should I do to make it work ?