Skip to content

wngr/libp2p-combined-transport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libp2p-combined-transport

License Cargo Documentation

Libp2p Transport combining two other transports. One of which is the base transport (like TCP), and another one is a higher-level transport (like WebSocket). Similar to [OrTransport], this tries to dial first with the outer connection, and if that fails, with the base one. The main difference is that incoming connections can be accepted on either one of them. For this to work, a switch must be provided when handling incoming connections. For example for TCP, this can be achieved with the peek method on the underlying [TcpStream]. [ListenerEvent]s from the base transport are cloned and routed to the outer transport via the [ProxyTransport], with the exception of upgrades.

For a usage example, have a look at the TCP-Websocket example.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE2.md
MIT
LICENSE-MIT.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages