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

[Feature Request] Allow setting custom protocol in mplex #2344

Closed
hanabi1224 opened this issue Nov 16, 2021 · 0 comments · Fixed by #2332
Closed

[Feature Request] Allow setting custom protocol in mplex #2344

hanabi1224 opened this issue Nov 16, 2021 · 0 comments · Fixed by #2332

Comments

@hanabi1224
Copy link
Contributor

in go-libp2p-muxer, it allows using custom protocol name. Adding a similar pub fn set_protocol to MplexConfig to connect to go nodes with custom protocol.

// Muxer configures libp2p to use the given stream multiplexer (or stream
// multiplexer constructor).
//
// Name is the protocol name.
//
// The transport can be a constructed mux.Transport or a function taking any
// subset of this libp2p node's:
// * Peer ID
// * Host
// * Network
// * Peerstore
func Muxer(name string, tpt interface{}) Option {
	mtpt, err := config.MuxerConstructor(tpt)
	err = traceError(err, 1)
	return func(cfg *Config) error {
		if err != nil {
			return err
		}
		cfg.Muxers = append(cfg.Muxers, config.MsMuxC{MuxC: mtpt, ID: name})
		return nil
	}
}
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 a pull request may close this issue.

1 participant