Automatic port forwarding using UPnP and invitation link system #27

Merged
CoCo_Sol merged 6 commits from upnp into main 2024-02-07 16:55:09 +00:00
Showing only changes of commit 33dd130e1c - Show all commits

View file

@ -20,9 +20,8 @@ use local_ip_address::local_ip;
/// use bevnet::{Connection, Listener}; /// use bevnet::{Connection, Listener};
/// ///
/// # fn main() -> io::Result<()> { /// # fn main() -> io::Result<()> {
/// let secret_key = Connection::generate_key(); /// let listener = Listener::new()?;
/// let listener = Listener::bind("127.0.0.1:23732", &secret_key)?; /// let mut connection = Connection::connect(&listener.connection_string())?;
/// let mut connection = Connection::connect("127.0.0.1:23732", &secret_key)?;
/// ///
/// // The accept operation is not blocking. So we need to loop here. /// // The accept operation is not blocking. So we need to loop here.
/// let mut server_connection; /// let mut server_connection;
@ -313,9 +312,8 @@ impl Connection {
/// use bevnet::{Connection, Listener}; /// use bevnet::{Connection, Listener};
/// ///
/// # fn main() -> io::Result<()> { /// # fn main() -> io::Result<()> {
/// let secret_key = Connection::generate_key(); /// let listener = Listener::new()?;
/// let listener = Listener::new(&secret_key)?; /// let mut connection = Connection::connect(&listener.connection_string())?;
/// let mut connection = Connection::connect(listener.connection_string())?;
/// ///
/// // The accept operation is not blocking. So we need to loop here. /// // The accept operation is not blocking. So we need to loop here.
/// let mut server_connection; /// let mut server_connection;