-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Running js-ipfs behind a proxy #1865
Comments
Ha, great question. Can we use a circuit address for this @jacobheun / @vasco-santos ? |
Meanwhile kept searching and found this - https://github.com/multiformats/js-multiaddr/blob/master/src/index.js#L182 - I wonder if this is a case were address encapsulation would be useful? 🤔 |
This is where libp2p/js-libp2p#202 would be very useful. It would provide the ability to set the listen/announce/no announce addresses without messing with the addresses after startup. @JGAntunes encapsulation/decapsulation is likely the best workaround without adding the config changes to libp2p, which would be the best option. The encapsulation workaround will require some post processing on the peerInfo multiaddrs after libp2p has started. We currently do something similar on boot for the transport listeners in libp2p-switch, https://github.com/libp2p/js-libp2p-switch/blob/v0.41.5/src/transport.js#L171. You could do the replace with the encapsulated address, which would be your proxy address |
@jacobheun yes that would be perfect! Thanks for pointing that out 👍 I don't have much free time on my hands but maybe I can help out with that (moving this discussion to the issue). Meanwhile I'll probably take your advice with the second approach so that I can get quickly unblocked. Thanks again for all the pointers 🙏 |
And I think it's ok to close this 👍 thank you @jacobheun and @alanshaw. |
Hey there! 👋
tl;dr; Is there a way for a node to "advertise" one swarm address without binding to it?
I've been looking into running some tests with multiple IPFS nodes running behind a TCP proxy. I'm using a bootstrap discovery method with 3 initial nodes deployed followed by another set of them. The config I'm using is something like this:
And the TCP proxy running at port
8002
forwarding traffic to the ipfs swarm address.I came to find however that given the peer doesn't know its own address, other peers end up with peer lists like this (notice the two peers with a
127.0.0.1
address):If I try to use the proxy address in the swarm config it will fail because the node tries to bind to it. So I guess what I need is some way for the peer to list an address without binding to it, is this possible? I was looking around in
libp2p
for something that would allow this behaviour but to no luck 😞 do any of you know a way around this?The text was updated successfully, but these errors were encountered: