Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Auto Client/Server Mode #234

Closed
Tracked by #3905
achingbrain opened this issue Oct 1, 2021 · 2 comments
Closed
Tracked by #3905

Auto Client/Server Mode #234

achingbrain opened this issue Oct 1, 2021 · 2 comments

Comments

@achingbrain
Copy link
Member

Go-libp2p automatically detects its public/private status. It starts in client (queries) mode and if it determines its diallable will switch to server (mounts the protocol in multistream and responds to queries).

This can also be manually set.

We can leave this as manual in JS for now. It will require some work in libp2p for address detection to get auto mode working properly.

@achingbrain
Copy link
Member Author

Autonat is coming in libp2p/js-libp2p#1298

After this is merged we need to:

  1. Listen for the change:addresses event emitted by the AddressManager
    a. Does the new address list contain public IPs? Are we in client mode? Enable server mode.
    b. Does the new address list not contain public IPs? Are we in server mode? Enable client mode.

@achingbrain
Copy link
Member Author

This has been implemented in #473

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant