Compare commits

...

5 commits

Author SHA1 Message Date
18eb357092
time out when client too slow 2024-11-07 21:21:45 +01:00
135cc71df0
Add LICENSE 2024-11-07 21:21:17 +01:00
a1693b1ff7
fix using the wrong listen ip 2024-10-18 11:58:22 +02:00
ccefec16a2
bump version 2024-10-18 11:27:20 +02:00
f5ea5cb3a1
ipv6 support :D 2024-10-18 11:25:41 +02:00
4 changed files with 14 additions and 3 deletions

2
Cargo.lock generated
View file

@ -86,7 +86,7 @@ dependencies = [
[[package]] [[package]]
name = "revpfw3" name = "revpfw3"
version = "0.4.0" version = "0.4.1"
dependencies = [ dependencies = [
"enum-ordinalize", "enum-ordinalize",
"serial", "serial",

View file

@ -3,7 +3,7 @@ name = "revpfw3"
repository = "https://github.com/tudbut/revpfw3" repository = "https://github.com/tudbut/revpfw3"
description = "A tool to bypass portforwarding restrictions using some cheap VServer" description = "A tool to bypass portforwarding restrictions using some cheap VServer"
license = "MIT" license = "MIT"
version = "0.4.0" version = "0.4.3"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

8
LICENSE Normal file
View file

@ -0,0 +1,8 @@
Copyright 2024 TudbuT <legal@mail.tudbut.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -36,9 +36,12 @@ pub fn server(port: u16, key: &str, sleep_delay_ms: u64) {
let mut buf8 = [0u8; 8]; let mut buf8 = [0u8; 8];
let mut buf16 = [0u8; 16]; let mut buf16 = [0u8; 16];
let mut buf = [0; 1024]; let mut buf = [0; 1024];
let tcpl = TcpListener::bind(("0.0.0.0", port)).unwrap(); let tcpl = TcpListener::bind(("::0", port)).unwrap();
let mut tcp = loop { let mut tcp = loop {
let Ok(mut tcp) = tcpl.accept() else { continue }; let Ok(mut tcp) = tcpl.accept() else { continue };
tcp.0
.set_read_timeout(Some(Duration::from_secs(5)))
.unwrap();
let Ok(()) = tcp.0.read_exact(&mut buf4) else { let Ok(()) = tcp.0.read_exact(&mut buf4) else {
tcp.0.shutdown(Shutdown::Both).unwrap(); tcp.0.shutdown(Shutdown::Both).unwrap();
continue; continue;