expose-rs

Crates.ioexpose-rs
lib.rsexpose-rs
version0.1.3
sourcesrc
created_at2024-08-26 23:08:04.226959
updated_at2024-08-26 23:37:48.689185
descriptionJust exposes your port to public
homepage
repositoryhttps://github.com/awaydev/expose-rs
max_upload_size
id1352689
size11,632
(awaydev)

documentation

README

Expose-rs

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).

Usage

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?
Commit count: 0

cargo fmt