Crates.io | expose-rs |
lib.rs | expose-rs |
version | 0.1.3 |
source | src |
created_at | 2024-08-26 23:08:04.226959 |
updated_at | 2024-08-26 23:37:48.689185 |
description | Just exposes your port to public |
homepage | |
repository | https://github.com/awaydev/expose-rs |
max_upload_size | |
id | 1352689 |
size | 11,632 |
This is very simple library for Port Forwarding in Rust. I saw others' solutions, but they are kinda complicated and have tons of dependencies (that's not you'd like to see precisely in Rust).
The library is with standard functions (not async, futures, tokio, etc.). If you're using async functions, this is may not your choice here... but you always can spawn threads! Also, this library uses only WANIPConnection1 interface.
Everything in one example
let session = discover().unwrap();
forward_port(&session, "TCP", 6969, 6969, "test", 0).unwrap(); // forwards internal 6969 port to external 6969
remove_port(&session, "TCP", 6969).unwrap(); // closes external 6969 port
get_extenral_ip(&session).unwrap(); // do I need describe what that function does?