1
0
Fork 0
mirror of https://github.com/azalea-rs/azalea-viaversion.git synced 2025-08-02 23:44:39 +00:00
azalea-viaversion/examples/swarm.rs
mat b847cc2bf1
Support Socks5 proxies (#14)
* add support for socks5 proxies

* update Cargo.lock and fix doctest

* make cli example docs use a code block for example usage
2025-05-07 16:50:14 -05:00

19 lines
667 B
Rust

//! A super basic example of adding a `ViaVersionPlugin` to a `SwarmBuilder` and
//! connecting to a localhost server.
use azalea::{prelude::*, swarm::SwarmBuilder};
use azalea_viaversion::ViaVersionPlugin;
#[tokio::main]
async fn main() {
tracing_subscriber::fmt::init();
// Initialize a 1.21.4 ViaProxy instance
let plugin = ViaVersionPlugin::start("1.21.4").await;
// Create a SwarmBuilder and add the ViaVersion plugin
let builder = SwarmBuilder::new().add_plugins(plugin);
// Start the client and connect to a localhost server
let acc = Account::offline("Azalea");
builder.add_account(acc).start("localhost").await.unwrap()
}