* move host/relay to host/autorelay
* move autorelay wrapper host to package
* support v2 relays in autorelay
* test autorelay with both v1 and v2 relays
* fix test race
* go mod tidy examples/pubsub/chat
static checker complains; sigh.
* refactor reservation refresh loop
* merge background and refresh goroutines
* handle pushes synchronously from reservation refresh failures
* make connmanager tag a package level constant
* dont sleep to wait for identify, use IdentifyWait
* make relay protocol ids package-level constants
* add comment about v1 relays not having reservations
* use errgrp instead of WaitGroup with atomic int
* fix variable capture bug
* go get x/sync
* hole punching protocol
* implement the new retry logic (opening a new stream per hole punch)
* rename the holepunch.HolePunchService to holepunch.Service
* remove stream handler when closing
* remove misleading comment from protobuf, add link to spec
* remove unnecessary netNotifiee.HolePunchService
* simplify receiving from the timer channel
* don't defer the closing of the hole punching stream
* only accept hole punch streams from relayed peers
* refactor error logging
* fix incorrect counting of incoming hole punch attempts
* rename HolePunch to DirectConnect
* fix usage of the wait group to close the hole punch service
* use a gc to the garbage collect the holepunch tracer
* check directionality of connection when accepting the hole punch stream
* add comment why we only call Connect once
* move deduplication logic to the holepunch service
Co-authored-by: aarshkshah1992 <aarshkshah1992@gmail.com>
The new `Filters` option allows users to take ownership of the `Filters` struct, and is suitable for cases where the addresses you want to accept/deny change dynamically.
Instead of using a global variable.
This also:
* Adds an option to the identify service to set the user agent.
* Removes the ability to pass an identify service to NewHost as any reasonable
Identify service already needs to be constructed with an instance of the host.
So, in go-ipfs at least, we *don't* pass the listen addresses into the libp2p
constructor. Instead, we specify them later.
This option allows us to tell libp2p to not listen by default.