mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-21 16:41:01 +00:00
Implement first, unfinished version of DNS support and fix incomplete TCP stream bug
This commit does two things: First, it implements a first, unfinished version of the virtual DNS functionality. This feature is incomplete and has known bugs. Since it needs to be enabled manually, this is not a huge issue so far. Second, the commit fixes a bug where TCP streams where not properly relayed, causing TCP connections to stall.
This commit is contained in:
parent
56d0dd9d42
commit
c9297124e1
5 changed files with 375 additions and 54 deletions
|
@ -1,5 +1,5 @@
|
|||
use crate::error::{s2e, Error};
|
||||
use crate::tun2proxy::Credentials;
|
||||
use crate::tun2proxy::{Credentials, Options};
|
||||
use crate::{http::HttpManager, socks5::Socks5Manager, tun2proxy::TunToProxy};
|
||||
use std::net::{SocketAddr, ToSocketAddrs};
|
||||
|
||||
|
@ -8,6 +8,7 @@ pub mod http;
|
|||
pub mod socks5;
|
||||
pub mod tun2proxy;
|
||||
pub mod virtdevice;
|
||||
pub mod virtdns;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Proxy {
|
||||
|
@ -75,8 +76,8 @@ impl std::fmt::Display for ProxyType {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn main_entry(tun: &str, proxy: Proxy) {
|
||||
let mut ttp = TunToProxy::new(tun);
|
||||
pub fn main_entry(tun: &str, proxy: Proxy, options: Options) {
|
||||
let mut ttp = TunToProxy::new(tun, options);
|
||||
match proxy.proxy_type {
|
||||
ProxyType::Socks5 => {
|
||||
ttp.add_connection_manager(Socks5Manager::new(proxy.addr, proxy.credentials));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue