diff --git a/.github/workflows/publish-exe.yml b/.github/workflows/publish-exe.yml index 4a316b5..5e9e500 100644 --- a/.github/workflows/publish-exe.yml +++ b/.github/workflows/publish-exe.yml @@ -62,14 +62,15 @@ jobs: else cargo build --all-features --release --target ${{ matrix.target }} fi + cbindgen --config cbindgen.toml -l C -o target/tun2proxy-ffi.h if [[ "${{ matrix.host_os }}" == "windows-latest" ]]; then powershell -Command "(Get-Item README.md).LastWriteTime = Get-Date" powershell -Command "(Get-Item target/${{ matrix.target }}/release/wintun.dll).LastWriteTime = Get-Date" - powershell Compress-Archive -Path target/${{ matrix.target }}/release/tun2proxy.exe, README.md, target/${{ matrix.target }}/release/wintun.dll -DestinationPath mypubdir4/tun2proxy-${{ matrix.target }}.zip + powershell Compress-Archive -Path target/${{ matrix.target }}/release/tun2proxy.exe, README.md, target/tun2proxy-ffi.h, target/${{ matrix.target }}/release/tun2proxy.dll, target/${{ matrix.target }}/release/wintun.dll -DestinationPath mypubdir4/tun2proxy-${{ matrix.target }}.zip elif [[ "${{ matrix.host_os }}" == "macos-latest" ]]; then - zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy README.md + zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy README.md target/tun2proxy-ffi.h target/${{ matrix.target }}/release/libtun2proxy.dylib elif [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then - zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy README.md + zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy README.md target/tun2proxy-ffi.h target/${{ matrix.target }}/release/libtun2proxy.so fi - name: Publish diff --git a/Cargo.toml b/Cargo.toml index 7db99ec..5bb8714 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tun2proxy" -version = "0.2.5" +version = "0.2.6" edition = "2021" license = "MIT" repository = "https://github.com/blechschmidt/tun2proxy" diff --git a/apple/tun2proxy/Tun2proxyWrapper.m b/apple/tun2proxy/Tun2proxyWrapper.m index 76f6ac7..3620390 100644 --- a/apple/tun2proxy/Tun2proxyWrapper.m +++ b/apple/tun2proxy/Tun2proxyWrapper.m @@ -15,8 +15,10 @@ + (void)startWithConfig:(NSString *)proxy_url tun_fd:(int)tun_fd tun_mtu:(uint32_t)tun_mtu - dns_strategy:(ArgDns)dns_strategy - verbosity:(ArgVerbosity)verbosity { + dns_over_tcp:(bool)dns_over_tcp + verbose:(bool)verbose { + ArgDns dns_strategy = dns_over_tcp ? OverTcp : Direct; + ArgVerbosity verbosity = verbose ? Trace : Info; tun2proxy_run(proxy_url.UTF8String, tun_fd, tun_mtu, dns_strategy, verbosity); } diff --git a/src/lib.rs b/src/lib.rs index 5bd32b5..d1fde87 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,10 +4,10 @@ use crate::{ session_info::{IpProtocol, SessionInfo}, virtual_dns::VirtualDns, }; -pub use clap; use ipstack::stream::{IpStackStream, IpStackTcpStream, IpStackUdpStream}; use proxy_handler::{ProxyHandler, ProxyHandlerManager}; use socks::SocksProxyManager; +pub use socks5_impl::protocol::UserKey; use std::{collections::VecDeque, future::Future, net::SocketAddr, pin::Pin, sync::Arc}; use tokio::{ io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt},