Skip to content
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

fix: minimal autonat dialer #849

Merged
merged 1 commit into from
Mar 22, 2020
Merged

fix: minimal autonat dialer #849

merged 1 commit into from
Mar 22, 2020

Conversation

Stebalien
Copy link
Member

Currently, the AutoNAT dialer spins up a full host with identify, ping, etc. this switches to a blankhost.

This also avoids running a relay, listening on transports, etc (regression).

Currently, the AutoNAT dialer spins up a full host with identify, ping, etc.
this switches to a blankhost.

This also avoids running a relay, listening on transports, etc (regression).
if err != nil {
h.Close()
return nil, err
}

dialerHost := blankhost.NewBlankHost(dialer)
err = autoNatCfg.addTransports(ctx, dialerHost)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addTransports looks like it could plausibly be refactored to take a network directly, in which case we could just pass the dialer directly without ever creating the blank host. would that be more efficient?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, transports can currently accept a Host through reflection magic and we can't really switch that to Network because some transports might need to register a stream listener (only available on host).

@Stebalien Stebalien merged commit 3f7e86b into master Mar 22, 2020
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

Successfully merging this pull request may close these issues.

2 participants