Skip to content

Allow to define vias. #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Jorropo opened this issue Jun 13, 2019 · 0 comments
Closed

Allow to define vias. #12

Jorropo opened this issue Jun 13, 2019 · 0 comments

Comments

@Jorropo
Copy link

Jorropo commented Jun 13, 2019

I was thinking how to do an i2p implementation.
And I realised somethings, some transport need configuration on the client to works, but this config may change from one client to an other.
It could be done by adding a way to register vias.

Vias is just a protocol (name or code) with the coresponding multiaddr used to access this protocol.

How it could looks in a json config file :

{
  "Vias":{
    "onion": "/ip4/127.0.0.1/tcp/9050/socks5",
    "onion3": "/ip4/127.0.0.1/tcp/9050/socks5",
    "i2p": [
      "/ip4/127.0.0.1/tcp/6665/sam3/libp2pTunnel",
      "/ip4/127.0.0.1/tcp/6666/socks4"
    ],
    "cjdns": "/p2p-circuit/QmHereANodeWithCJDNSUsedAsRelay"
  }
}

After I should be able to seemlessly connect to onion address because libp2p should automaticaly encapsulate all onion address with my proxy.
So /onion/hereexampleonionaddr seemlessly mutate to /ip4/127.0.0.1/tcp/9050/socks5/onion/hereexampleonionaddr but only on my node.
Here the example with cjdns is just to demonstrate it could be used with all kind of proxy, but for a specifical cjdns connection autorelay is probably better because all connection will pass through the seted proxy while autorelay automaticaly do new relay.

You can also see i2p have 2 proxy, that just for fail over (implementation managed, it could also be used for load balancing).
But I think this is prettier if we do that with :

{
  "Vias":{
    "onion": "/ip4/127.0.0.1/tcp/9050/socks5",
    "onion3": "/ip4/127.0.0.1/tcp/9050/socks5",
    "i2p": "/ip4/127.0.0.1/tcp/6665/sam3/libp2pTunnel",
    "i2p": "/ip4/192.168.0.4/tcp/6666/socks4",
    "cjdns": "/p2p-circuit/QmHereANodeWithCJDNSUsedAsRelay"
  }
}

But that not vanilla json.
In the code that could be managed with some function like addViaToProtocol(ProtocolCode, Multiaddr), clearProtocolVia(ProtocolCode) and maybe removeViaToProtocol(ProtocolCode, Multiaddr).

That could be usefull for very easy i2p, onion, cjdns, ... implementation via a manual configuration.
First configure your hidden service, then add the hidden services address in announce and finaly add your proxy.

@Jorropo Jorropo closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant