This tutorial introduced the RTCConnection object, which can be used both from Python and from javascript to create a WebRTC connection . With that, a connection between conn and conn2 is established. Both in javascript and in Python you can use put_nowait and subscribe to send and receive messages, respectively.