5 Commits

Author SHA1 Message Date
Datong Sun
726ecac9cf chore(phantun) bump phantun to v0.2.5 2022-01-03 07:47:48 -08:00
dependabot[bot]
2ef0a056be chore(deps): update clap requirement from 2.34 to 3.0
Updates the requirements on [clap](https://github.com/clap-rs/clap) to permit the latest version.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_generate-v3.0.0-rc.0...clap_complete-v3.0.0)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-03 23:45:13 +08:00
Datong Sun
cb9dd3e931 fix(client) disable AAAA resolve, since tokio-tun does not yet have IPv6
support. See: https://github.com/yaa110/tokio-tun/pull/8
2022-01-03 23:37:31 +08:00
Datong Sun
7db7164193 chore(*) use tokio-tun v0.5 instead of forked version. Bumped
`fake-tcp` to `v0.2.3`
2021-12-07 17:07:54 +08:00
Datong Sun
def134d73b docs(readme) bump latest version to v0.2.4 2021-12-05 07:13:01 -08:00
6 changed files with 24 additions and 29 deletions

View File

@@ -31,7 +31,7 @@ Table of Contents
# Latest release
[v0.2.3](https://github.com/dndx/phantun/releases/tag/v0.2.3)
[v0.2.4](https://github.com/dndx/phantun/releases/tag/v0.2.4)
# Overview

View File

@@ -1,6 +1,6 @@
[package]
name = "fake-tcp"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
authors = ["Datong Sun <dndx@idndx.com>"]
license = "MIT OR Apache-2.0"
@@ -21,4 +21,4 @@ tokio = { version = "1.14", features = ["full"] }
rand = { version = "0.8", features = ["small_rng"] }
log = "0.4"
internet-checksum = "0.2"
dndx-fork-tokio-tun = "0.4"
tokio-tun = "0.5"

View File

@@ -1,7 +1,6 @@
#![cfg_attr(feature = "benchmark", feature(test))]
pub mod packet;
extern crate dndx_fork_tokio_tun as tokio_tun;
use bytes::{Bytes, BytesMut};
use log::{error, info, trace, warn};

View File

@@ -1,6 +1,6 @@
[package]
name = "phantun"
version = "0.2.4"
version = "0.2.5"
edition = "2021"
authors = ["Datong Sun <dndx@idndx.com>"]
license = "MIT OR Apache-2.0"
@@ -11,11 +11,11 @@ Transforms UDP stream into (fake) TCP streams that can go through
Layer 3 & Layer 4 (NAPT) firewalls/NATs.
"""
[dependencies]
clap = "2.34"
clap = { version = "3.0", features = ["cargo"] }
socket2 = { version = "0.4", features = ["all"] }
fake-tcp = "0.2.2"
fake-tcp = "0.2"
tokio = { version = "1.14", features = ["full"] }
log = "0.4"
pretty_env_logger = "0.4"
dndx-fork-tokio-tun = "0.4"
tokio-tun = "0.5"
num_cpus = "1.13"

View File

@@ -1,5 +1,3 @@
extern crate dndx_fork_tokio_tun as tokio_tun;
use clap::{crate_version, App, Arg};
use fake_tcp::packet::MAX_PACKET_LEN;
use fake_tcp::{Socket, Stack};
@@ -44,8 +42,8 @@ async fn main() {
.version(crate_version!())
.author("Datong Sun (github.com/dndx)")
.arg(
Arg::with_name("local")
.short("l")
Arg::new("local")
.short('l')
.long("local")
.required(true)
.value_name("IP:PORT")
@@ -53,8 +51,8 @@ async fn main() {
.takes_value(true),
)
.arg(
Arg::with_name("remote")
.short("r")
Arg::new("remote")
.short('r')
.long("remote")
.required(true)
.value_name("IP or HOST NAME:PORT")
@@ -62,7 +60,7 @@ async fn main() {
.takes_value(true),
)
.arg(
Arg::with_name("tun")
Arg::new("tun")
.long("tun")
.required(false)
.value_name("tunX")
@@ -71,7 +69,7 @@ async fn main() {
.takes_value(true),
)
.arg(
Arg::with_name("tun_local")
Arg::new("tun_local")
.long("tun-local")
.required(false)
.value_name("IP")
@@ -80,7 +78,7 @@ async fn main() {
.takes_value(true),
)
.arg(
Arg::with_name("tun_peer")
Arg::new("tun_peer")
.long("tun-peer")
.required(false)
.value_name("IP")
@@ -101,12 +99,12 @@ async fn main() {
let remote_addr = tokio::net::lookup_host(matches.value_of("remote").unwrap())
.await
.expect("bad remote address or host")
.next()
.expect("unable to resolve remote host name");
.find(|addr| addr.is_ipv4())
.expect("unable to resolve remote host name or no valid A record was returned");
let remote_addr = if let SocketAddr::V4(addr) = remote_addr {
addr
} else {
panic!("only IPv4 remote address is supported");
unreachable!();
};
info!("Remote address is: {}", remote_addr);

View File

@@ -1,5 +1,3 @@
extern crate dndx_fork_tokio_tun as tokio_tun;
use clap::{crate_version, App, Arg};
use fake_tcp::packet::MAX_PACKET_LEN;
use fake_tcp::Stack;
@@ -18,8 +16,8 @@ async fn main() {
.version(crate_version!())
.author("Datong Sun (github.com/dndx)")
.arg(
Arg::with_name("local")
.short("l")
Arg::new("local")
.short('l')
.long("local")
.required(true)
.value_name("PORT")
@@ -27,8 +25,8 @@ async fn main() {
.takes_value(true),
)
.arg(
Arg::with_name("remote")
.short("r")
Arg::new("remote")
.short('r')
.long("remote")
.required(true)
.value_name("IP or HOST NAME:PORT")
@@ -36,7 +34,7 @@ async fn main() {
.takes_value(true),
)
.arg(
Arg::with_name("tun")
Arg::new("tun")
.long("tun")
.required(false)
.value_name("tunX")
@@ -45,7 +43,7 @@ async fn main() {
.takes_value(true),
)
.arg(
Arg::with_name("tun_local")
Arg::new("tun_local")
.long("tun-local")
.required(false)
.value_name("IP")
@@ -54,7 +52,7 @@ async fn main() {
.takes_value(true),
)
.arg(
Arg::with_name("tun_peer")
Arg::new("tun_peer")
.long("tun-peer")
.required(false)
.value_name("IP")