p2p-quic-migration is a project to seek the smallest interruption time when a peer's IP address has changed during p2p connection.
This project uses a modified version of quic-go. Place this repository and quic-go in the same directory hierarchy and it will work (if not, let me know).
This project requires GStreamer for audio streaming. Install it and its plugins.
Note for macOS: If you see GLib warnings like "Failed to load shared library 'libgobject-2.0.0.dylib'", install additional dependencies and set variables:
brew install glib gobject-introspection
export DYLD_LIBRARY_PATH="/opt/homebrew/opt/glib/lib:$DYLD_LIBRARY_PATH"
export GI_TYPELIB_PATH="/opt/homebrew/lib/girepository-1.0:$GI_TYPELIB_PATH"Verify Installation:
gst-launch-1.0 --version # or just gstreamer --version# Run peer
make peer
# Run intermediate server
make intermediate
# Generate certs for servers. Running any component with make will automatically run this beforehand
make cert
# Build binaries
make build- Run
make intermediatesomewhere - Run
make peeron a machine behind NAT with your media files at ./static/output.mp3 - Run
make peeron another machine behind NAT
You must run the peers on different networks unless your router supports NAT loopback (a.k.a. NAT hairpinning).
If the connection succeeds, you should hear the audio. Then try switching the client's network (WiFi to cellular for example). The sound will be interrupted for like 3 sec and recovered soon.
Peers can run with explicit roles via flags:
# sender
make ps INTERMEDIATE_ADDR=<host:port>
# receiver
make pr INTERMEDIATE_ADDR=<host:port>senderopens an outgoing audio stream to the peer but does not play incoming audio.receiveraccepts and plays incoming audio but does not open outgoing audio streams.