8bcffb67cb
* ignore TODO and kademlia * remove unnecessary pass * fixed swarm warnings * fixed peerdata_interface warnings * fixed peer warnings * fixed rest of linting errors * trying to fix last error * fixed dup errors
28 lines
664 B
Python
28 lines
664 B
Python
from stream_muxer.mplex.mplex import Mplex
|
|
|
|
|
|
class TransportUpgrader():
|
|
# pylint: disable=no-self-use
|
|
|
|
def __init__(self, secOpt, muxerOpt):
|
|
self.sec = secOpt
|
|
self.muxer = muxerOpt
|
|
|
|
def upgrade_listener(self, transport, listeners):
|
|
"""
|
|
upgrade multiaddr listeners to libp2p-transport listeners
|
|
|
|
"""
|
|
|
|
def upgrade_security(self):
|
|
pass
|
|
|
|
def upgrade_connection(self, conn, initiator):
|
|
"""
|
|
upgrade raw connection to muxed connection
|
|
"""
|
|
|
|
# For PoC, no security, default to mplex
|
|
# TODO do exchange to determine multiplexer
|
|
return Mplex(conn, initiator)
|