Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

use the ipnet.PSK instead of the ipnet.Protector for private networks #45

Merged
merged 1 commit into from Mar 7, 2020

Conversation

marten-seemann
Copy link
Contributor

See libp2p/go-libp2p-core#118 for the interface change.

Looks like we'll need to update go.mod before merging this PR (after releasing a new version of go-libp2p-pnet containing libp2p/go-libp2p-pnet#32).

Tracking issue: libp2p/go-libp2p#795.

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

LGTM but don't merge yet.

if u.Protector != nil {
pconn, err := u.Protector.Protect(conn)
if u.PSK != nil {
pconn, err := pnet.NewProtectedConn(u.PSK, conn)
Copy link
Member

Choose a reason for hiding this comment

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

future: We may want to eventually expose this as a "Protect" function so transports can choose which pieces of the upgrader they want to use.

@Stebalien Stebalien merged commit 43d1c53 into master Mar 7, 2020
@Stebalien Stebalien deleted the generalize-private-network branch March 7, 2020 02:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants