From d96257001674e977f9f1449905a57f97dd24f182 Mon Sep 17 00:00:00 2001 From: NNdroid <99177648+NNdroid@users.noreply.github.com> Date: Fri, 25 Aug 2023 19:05:43 +0800 Subject: [PATCH] support for loading default settings from configuration files --- common/config/config.go | 38 +++++++++++++++- common/{ => x}/xchan/ringbuffer.go | 0 common/{ => x}/xchan/unbounded_chan.go | 0 common/{ => x}/xcrypto/xcrypto.go | 0 common/{ => x}/xcrypto/xcrypto_test.go | 0 common/{ => x}/xproto/xproto.go | 0 common/{ => x}/xproto/xproto_test.go | 0 common/{ => x}/xtun/xtun.go | 2 +- config.json => example/config.json | 0 main.go | 60 ++++++++++++++------------ mobile/dtlsclient/dtlsclient.go | 2 +- mobile/h1client/h1client.go | 2 +- mobile/h2client/h2client.go | 2 +- mobile/kcpclient/kcpclient.go | 2 +- mobile/quicclient/quicclient.go | 2 +- mobile/tcpclient/tcpclient.go | 2 +- mobile/tlsclient/tlsclient.go | 2 +- mobile/utlsclient/utlsclient.go | 2 +- mobile/wsclient/wsclient.go | 2 +- mobile/xcrypto/xcrypto.go | 2 +- transport/protocol/dtls/dtlsclient.go | 4 +- transport/protocol/dtls/dtlsserver.go | 2 +- transport/protocol/h1/h1client.go | 2 +- transport/protocol/h2/h2client.go | 4 +- transport/protocol/h2/h2server.go | 2 +- transport/protocol/kcp/kcpclient.go | 4 +- transport/protocol/kcp/kcpserver.go | 2 +- transport/protocol/quic/quicclient.go | 7 ++- transport/protocol/quic/quicserver.go | 2 +- transport/protocol/tcp/tcpclient.go | 7 ++- transport/protocol/tcp/tcpserver.go | 4 +- transport/protocol/tls/tlsclient.go | 2 +- transport/protocol/utls/utlsclient.go | 2 +- transport/protocol/ws/wsclient.go | 2 +- 34 files changed, 101 insertions(+), 65 deletions(-) rename common/{ => x}/xchan/ringbuffer.go (100%) rename common/{ => x}/xchan/unbounded_chan.go (100%) rename common/{ => x}/xcrypto/xcrypto.go (100%) rename common/{ => x}/xcrypto/xcrypto_test.go (100%) rename common/{ => x}/xproto/xproto.go (100%) rename common/{ => x}/xproto/xproto_test.go (100%) rename common/{ => x}/xtun/xtun.go (95%) rename config.json => example/config.json (100%) diff --git a/common/config/config.go b/common/config/config.go index b98d612..d566f3d 100644 --- a/common/config/config.go +++ b/common/config/config.go @@ -35,14 +35,48 @@ type Config struct { Host string `json:"host"` } -func (c Config) LoadConfig(configFile string, config *Config) (err error) { +type nativeConfig Config + +var DefaultConfig = nativeConfig{ + DeviceName: "", + LocalAddr: ":3000", + ServerAddr: ":3001", + ServerIP: "172.16.0.1", + ServerIPv6: "fced:9999::1", + CIDR: "172.16.0.10/24", + CIDRv6: "fced:9999::9999/64", + Key: "freedom@2023", + Protocol: "udp", + Path: "/freedom", + ServerMode: false, + GlobalMode: false, + Obfs: false, + Compress: false, + MTU: 1500, + Timeout: 30, + TLSCertificateFilePath: "./certs/server.pem", + TLSCertificateKeyFilePath: "./certs/server.key", + TLSSni: "", + TLSInsecureSkipVerify: false, + Verbose: false, + PSKMode: false, + Host: "", +} + +func (c *Config) UnmarshalJSON(data []byte) error { + _ = json.Unmarshal(data, &DefaultConfig) + *c = Config(DefaultConfig) + return nil +} + +func (c *Config) LoadConfig(configFile string) (err error) { file, err := os.Open(configFile) if err != nil { return } defer file.Close() decoder := json.NewDecoder(file) - err = decoder.Decode(config) + err = decoder.Decode(c) if err != nil { return } diff --git a/common/xchan/ringbuffer.go b/common/x/xchan/ringbuffer.go similarity index 100% rename from common/xchan/ringbuffer.go rename to common/x/xchan/ringbuffer.go diff --git a/common/xchan/unbounded_chan.go b/common/x/xchan/unbounded_chan.go similarity index 100% rename from common/xchan/unbounded_chan.go rename to common/x/xchan/unbounded_chan.go diff --git a/common/xcrypto/xcrypto.go b/common/x/xcrypto/xcrypto.go similarity index 100% rename from common/xcrypto/xcrypto.go rename to common/x/xcrypto/xcrypto.go diff --git a/common/xcrypto/xcrypto_test.go b/common/x/xcrypto/xcrypto_test.go similarity index 100% rename from common/xcrypto/xcrypto_test.go rename to common/x/xcrypto/xcrypto_test.go diff --git a/common/xproto/xproto.go b/common/x/xproto/xproto.go similarity index 100% rename from common/xproto/xproto.go rename to common/x/xproto/xproto.go diff --git a/common/xproto/xproto_test.go b/common/x/xproto/xproto_test.go similarity index 100% rename from common/xproto/xproto_test.go rename to common/x/xproto/xproto_test.go diff --git a/common/xtun/xtun.go b/common/x/xtun/xtun.go similarity index 95% rename from common/xtun/xtun.go rename to common/x/xtun/xtun.go index e5c6c56..e844230 100644 --- a/common/xtun/xtun.go +++ b/common/x/xtun/xtun.go @@ -4,7 +4,7 @@ import ( "context" "github.com/net-byte/vtun/common/config" "github.com/net-byte/vtun/common/netutil" - "github.com/net-byte/vtun/common/xproto" + "github.com/net-byte/vtun/common/x/xproto" "github.com/net-byte/water" ) diff --git a/config.json b/example/config.json similarity index 100% rename from config.json rename to example/config.json diff --git a/main.go b/main.go index 67bb7e6..5563817 100644 --- a/main.go +++ b/main.go @@ -25,42 +25,46 @@ func displayVersionInfo() { log.Printf("go version -> %s", _goVersion) } -func main() { - config := config.Config{} - var configFile string +var cfg = config.Config{} +var configFile string + +func init() { flag.StringVar(&configFile, "f", "", "config file") - flag.StringVar(&config.DeviceName, "dn", "", "device name") - flag.StringVar(&config.CIDR, "c", "172.16.0.10/24", "tun interface cidr") - flag.StringVar(&config.CIDRv6, "c6", "fced:9999::9999/64", "tun interface ipv6 cidr") - flag.IntVar(&config.MTU, "mtu", 1500, "tun mtu") - flag.StringVar(&config.LocalAddr, "l", ":3000", "local address") - flag.StringVar(&config.ServerAddr, "s", ":3001", "server address") - flag.StringVar(&config.ServerIP, "sip", "172.16.0.1", "server ip") - flag.StringVar(&config.ServerIPv6, "sip6", "fced:9999::1", "server ipv6") - flag.StringVar(&config.Key, "k", "freedom@2023", "key") - flag.StringVar(&config.Protocol, "p", "udp", "protocol udp/tls/grpc/quic/utls/dtls/h2/http/tcp/https/ws/wss") - flag.StringVar(&config.Path, "path", "/freedom", "path") - flag.BoolVar(&config.ServerMode, "S", false, "server mode") - flag.BoolVar(&config.GlobalMode, "g", false, "client global mode") - flag.BoolVar(&config.Obfs, "obfs", false, "enable data obfuscation") - flag.BoolVar(&config.Compress, "compress", false, "enable data compression") - flag.IntVar(&config.Timeout, "t", 30, "dial timeout in seconds") - flag.StringVar(&config.TLSCertificateFilePath, "certificate", "./certs/server.pem", "tls certificate file path") - flag.StringVar(&config.TLSCertificateKeyFilePath, "privatekey", "./certs/server.key", "tls certificate key file path") - flag.StringVar(&config.TLSSni, "sni", "", "tls handshake sni") - flag.BoolVar(&config.TLSInsecureSkipVerify, "isv", false, "tls insecure skip verify") - flag.BoolVar(&config.Verbose, "v", false, "enable verbose output") - flag.BoolVar(&config.PSKMode, "psk", false, "enable psk mode (dtls only)") - flag.StringVar(&config.Host, "host", "", "http host") + flag.StringVar(&cfg.DeviceName, "dn", config.DefaultConfig.DeviceName, "device name") + flag.StringVar(&cfg.CIDR, "c", config.DefaultConfig.CIDR, "tun interface cidr") + flag.StringVar(&cfg.CIDRv6, "c6", config.DefaultConfig.CIDRv6, "tun interface ipv6 cidr") + flag.IntVar(&cfg.MTU, "mtu", config.DefaultConfig.MTU, "tun mtu") + flag.StringVar(&cfg.LocalAddr, "l", config.DefaultConfig.LocalAddr, "local address") + flag.StringVar(&cfg.ServerAddr, "s", config.DefaultConfig.ServerAddr, "server address") + flag.StringVar(&cfg.ServerIP, "sip", config.DefaultConfig.ServerIP, "server ip") + flag.StringVar(&cfg.ServerIPv6, "sip6", config.DefaultConfig.ServerIPv6, "server ipv6") + flag.StringVar(&cfg.Key, "k", config.DefaultConfig.Key, "key") + flag.StringVar(&cfg.Protocol, "p", config.DefaultConfig.Protocol, "protocol udp/tls/grpc/quic/utls/dtls/h2/http/tcp/https/ws/wss") + flag.StringVar(&cfg.Path, "path", config.DefaultConfig.Path, "path") + flag.BoolVar(&cfg.ServerMode, "S", config.DefaultConfig.ServerMode, "server mode") + flag.BoolVar(&cfg.GlobalMode, "g", config.DefaultConfig.GlobalMode, "client global mode") + flag.BoolVar(&cfg.Obfs, "obfs", config.DefaultConfig.Obfs, "enable data obfuscation") + flag.BoolVar(&cfg.Compress, "compress", config.DefaultConfig.Compress, "enable data compression") + flag.IntVar(&cfg.Timeout, "t", config.DefaultConfig.Timeout, "dial timeout in seconds") + flag.StringVar(&cfg.TLSCertificateFilePath, "certificate", config.DefaultConfig.TLSCertificateFilePath, "tls certificate file path") + flag.StringVar(&cfg.TLSCertificateKeyFilePath, "privatekey", config.DefaultConfig.TLSCertificateKeyFilePath, "tls certificate key file path") + flag.StringVar(&cfg.TLSSni, "sni", config.DefaultConfig.TLSSni, "tls handshake sni") + flag.BoolVar(&cfg.TLSInsecureSkipVerify, "isv", config.DefaultConfig.TLSInsecureSkipVerify, "tls insecure skip verify") + flag.BoolVar(&cfg.Verbose, "v", config.DefaultConfig.Verbose, "enable verbose output") + flag.BoolVar(&cfg.PSKMode, "psk", config.DefaultConfig.PSKMode, "enable psk mode (dtls only)") + flag.StringVar(&cfg.Host, "host", config.DefaultConfig.Host, "http host") flag.Parse() +} + +func main() { displayVersionInfo() if configFile != "" { - err := config.LoadConfig(configFile, &config) + err := cfg.LoadConfig(configFile) if err != nil { log.Fatalf("Failed to load config from file: %s", err) } } - app := app.NewApp(&config, _version) + app := app.NewApp(&cfg, _version) app.InitConfig() go app.StartApp() quit := make(chan os.Signal, 1) diff --git a/mobile/dtlsclient/dtlsclient.go b/mobile/dtlsclient/dtlsclient.go index 45e1c5f..0afbbd2 100644 --- a/mobile/dtlsclient/dtlsclient.go +++ b/mobile/dtlsclient/dtlsclient.go @@ -2,7 +2,7 @@ package dtlsclient import ( "context" - "github.com/net-byte/vtun/common/xchan" + "github.com/net-byte/vtun/common/x/xchan" kc "github.com/net-byte/vtun/mobile/config" "github.com/net-byte/vtun/transport/protocol/dtls" ) diff --git a/mobile/h1client/h1client.go b/mobile/h1client/h1client.go index 16c8d8c..7a0b8f9 100644 --- a/mobile/h1client/h1client.go +++ b/mobile/h1client/h1client.go @@ -2,7 +2,7 @@ package h1client import ( "context" - "github.com/net-byte/vtun/common/xchan" + "github.com/net-byte/vtun/common/x/xchan" kc "github.com/net-byte/vtun/mobile/config" "github.com/net-byte/vtun/transport/protocol/h1" ) diff --git a/mobile/h2client/h2client.go b/mobile/h2client/h2client.go index 9ddb432..4400a46 100644 --- a/mobile/h2client/h2client.go +++ b/mobile/h2client/h2client.go @@ -2,7 +2,7 @@ package h2client import ( "context" - "github.com/net-byte/vtun/common/xchan" + "github.com/net-byte/vtun/common/x/xchan" kc "github.com/net-byte/vtun/mobile/config" "github.com/net-byte/vtun/transport/protocol/h2" ) diff --git a/mobile/kcpclient/kcpclient.go b/mobile/kcpclient/kcpclient.go index ec3f61c..c8a3bbb 100644 --- a/mobile/kcpclient/kcpclient.go +++ b/mobile/kcpclient/kcpclient.go @@ -2,7 +2,7 @@ package kcpclient import ( "context" - "github.com/net-byte/vtun/common/xchan" + "github.com/net-byte/vtun/common/x/xchan" kc "github.com/net-byte/vtun/mobile/config" "github.com/net-byte/vtun/transport/protocol/kcp" ) diff --git a/mobile/quicclient/quicclient.go b/mobile/quicclient/quicclient.go index bf98e8a..be47bae 100644 --- a/mobile/quicclient/quicclient.go +++ b/mobile/quicclient/quicclient.go @@ -2,7 +2,7 @@ package quicclient import ( "context" - "github.com/net-byte/vtun/common/xchan" + "github.com/net-byte/vtun/common/x/xchan" kc "github.com/net-byte/vtun/mobile/config" "github.com/net-byte/vtun/transport/protocol/quic" ) diff --git a/mobile/tcpclient/tcpclient.go b/mobile/tcpclient/tcpclient.go index 248841b..248ff31 100644 --- a/mobile/tcpclient/tcpclient.go +++ b/mobile/tcpclient/tcpclient.go @@ -2,7 +2,7 @@ package tcpclient import ( "context" - "github.com/net-byte/vtun/common/xchan" + "github.com/net-byte/vtun/common/x/xchan" kc "github.com/net-byte/vtun/mobile/config" "github.com/net-byte/vtun/transport/protocol/tcp" ) diff --git a/mobile/tlsclient/tlsclient.go b/mobile/tlsclient/tlsclient.go index a07be8c..73a7d58 100644 --- a/mobile/tlsclient/tlsclient.go +++ b/mobile/tlsclient/tlsclient.go @@ -2,7 +2,7 @@ package tlsclient import ( "context" - "github.com/net-byte/vtun/common/xchan" + "github.com/net-byte/vtun/common/x/xchan" kc "github.com/net-byte/vtun/mobile/config" "github.com/net-byte/vtun/transport/protocol/tls" ) diff --git a/mobile/utlsclient/utlsclient.go b/mobile/utlsclient/utlsclient.go index 22bfcc1..9d4a213 100644 --- a/mobile/utlsclient/utlsclient.go +++ b/mobile/utlsclient/utlsclient.go @@ -2,7 +2,7 @@ package utlsclient import ( "context" - "github.com/net-byte/vtun/common/xchan" + "github.com/net-byte/vtun/common/x/xchan" kc "github.com/net-byte/vtun/mobile/config" "github.com/net-byte/vtun/transport/protocol/utls" ) diff --git a/mobile/wsclient/wsclient.go b/mobile/wsclient/wsclient.go index 86f206f..84f159a 100644 --- a/mobile/wsclient/wsclient.go +++ b/mobile/wsclient/wsclient.go @@ -2,7 +2,7 @@ package wsclient import ( "context" - "github.com/net-byte/vtun/common/xchan" + "github.com/net-byte/vtun/common/x/xchan" kc "github.com/net-byte/vtun/mobile/config" "github.com/net-byte/vtun/transport/protocol/ws" ) diff --git a/mobile/xcrypto/xcrypto.go b/mobile/xcrypto/xcrypto.go index 33b52f3..2358ff6 100644 --- a/mobile/xcrypto/xcrypto.go +++ b/mobile/xcrypto/xcrypto.go @@ -3,7 +3,7 @@ package xcrypto import ( "github.com/golang/snappy" "github.com/net-byte/vtun/common/cipher" - "github.com/net-byte/vtun/common/xcrypto" + "github.com/net-byte/vtun/common/x/xcrypto" ) var xp = xcrypto.XCrypto{} diff --git a/transport/protocol/dtls/dtlsclient.go b/transport/protocol/dtls/dtlsclient.go index 57d9154..568b398 100644 --- a/transport/protocol/dtls/dtlsclient.go +++ b/transport/protocol/dtls/dtlsclient.go @@ -5,8 +5,8 @@ import ( "github.com/golang/snappy" "github.com/net-byte/vtun/common/cipher" "github.com/net-byte/vtun/common/counter" - "github.com/net-byte/vtun/common/xproto" - "github.com/net-byte/vtun/common/xtun" + "github.com/net-byte/vtun/common/x/xproto" + "github.com/net-byte/vtun/common/x/xtun" "github.com/pion/dtls/v2" "log" "net" diff --git a/transport/protocol/dtls/dtlsserver.go b/transport/protocol/dtls/dtlsserver.go index 8370a09..fa5c2ed 100644 --- a/transport/protocol/dtls/dtlsserver.go +++ b/transport/protocol/dtls/dtlsserver.go @@ -9,7 +9,7 @@ import ( "github.com/net-byte/vtun/common/config" "github.com/net-byte/vtun/common/counter" "github.com/net-byte/vtun/common/netutil" - "github.com/net-byte/vtun/common/xproto" + "github.com/net-byte/vtun/common/x/xproto" "github.com/net-byte/water" "github.com/pion/dtls/v2" "log" diff --git a/transport/protocol/h1/h1client.go b/transport/protocol/h1/h1client.go index 4c03249..1134651 100644 --- a/transport/protocol/h1/h1client.go +++ b/transport/protocol/h1/h1client.go @@ -3,7 +3,7 @@ package h1 import ( "context" "github.com/net-byte/vtun/common/counter" - "github.com/net-byte/vtun/common/xtun" + "github.com/net-byte/vtun/common/x/xtun" "github.com/net-byte/vtun/transport/protocol/tcp" "log" "time" diff --git a/transport/protocol/h2/h2client.go b/transport/protocol/h2/h2client.go index 78b422b..fba798d 100644 --- a/transport/protocol/h2/h2client.go +++ b/transport/protocol/h2/h2client.go @@ -10,8 +10,8 @@ import ( "github.com/net-byte/vtun/common/config" "github.com/net-byte/vtun/common/counter" "github.com/net-byte/vtun/common/netutil" - "github.com/net-byte/vtun/common/xproto" - "github.com/net-byte/vtun/common/xtun" + "github.com/net-byte/vtun/common/x/xproto" + "github.com/net-byte/vtun/common/x/xtun" "github.com/net-byte/water" "golang.org/x/net/http2" "io" diff --git a/transport/protocol/h2/h2server.go b/transport/protocol/h2/h2server.go index 69c4620..a172e2d 100644 --- a/transport/protocol/h2/h2server.go +++ b/transport/protocol/h2/h2server.go @@ -8,7 +8,7 @@ import ( "github.com/net-byte/vtun/common/config" "github.com/net-byte/vtun/common/counter" "github.com/net-byte/vtun/common/netutil" - "github.com/net-byte/vtun/common/xproto" + "github.com/net-byte/vtun/common/x/xproto" "github.com/net-byte/water" "io" "log" diff --git a/transport/protocol/kcp/kcpclient.go b/transport/protocol/kcp/kcpclient.go index dd4cc88..27ff46f 100644 --- a/transport/protocol/kcp/kcpclient.go +++ b/transport/protocol/kcp/kcpclient.go @@ -4,8 +4,8 @@ import ( "context" "crypto/sha1" "errors" - "github.com/net-byte/vtun/common/xproto" - "github.com/net-byte/vtun/common/xtun" + "github.com/net-byte/vtun/common/x/xproto" + "github.com/net-byte/vtun/common/x/xtun" "log" "runtime" "strings" diff --git a/transport/protocol/kcp/kcpserver.go b/transport/protocol/kcp/kcpserver.go index a22da29..c8cbc62 100644 --- a/transport/protocol/kcp/kcpserver.go +++ b/transport/protocol/kcp/kcpserver.go @@ -8,7 +8,7 @@ import ( "github.com/net-byte/vtun/common/config" "github.com/net-byte/vtun/common/counter" "github.com/net-byte/vtun/common/netutil" - "github.com/net-byte/vtun/common/xproto" + "github.com/net-byte/vtun/common/x/xproto" "github.com/net-byte/water" "github.com/xtaci/kcp-go" "golang.org/x/crypto/pbkdf2" diff --git a/transport/protocol/quic/quicclient.go b/transport/protocol/quic/quicclient.go index 6803105..df3b295 100644 --- a/transport/protocol/quic/quicclient.go +++ b/transport/protocol/quic/quicclient.go @@ -3,17 +3,16 @@ package quic import ( "context" "crypto/tls" + "github.com/net-byte/vtun/common/x/xproto" + "github.com/net-byte/vtun/common/x/xtun" "log" "time" - "github.com/net-byte/vtun/common/counter" - "github.com/net-byte/vtun/common/xproto" - "github.com/net-byte/vtun/common/xtun" - "github.com/golang/snappy" "github.com/net-byte/vtun/common/cache" "github.com/net-byte/vtun/common/cipher" "github.com/net-byte/vtun/common/config" + "github.com/net-byte/vtun/common/counter" "github.com/net-byte/vtun/common/netutil" "github.com/net-byte/water" "github.com/quic-go/quic-go" diff --git a/transport/protocol/quic/quicserver.go b/transport/protocol/quic/quicserver.go index da1671c..759224a 100644 --- a/transport/protocol/quic/quicserver.go +++ b/transport/protocol/quic/quicserver.go @@ -9,7 +9,7 @@ import ( "github.com/net-byte/vtun/common/config" "github.com/net-byte/vtun/common/counter" "github.com/net-byte/vtun/common/netutil" - "github.com/net-byte/vtun/common/xproto" + "github.com/net-byte/vtun/common/x/xproto" "github.com/net-byte/water" "github.com/quic-go/quic-go" "log" diff --git a/transport/protocol/tcp/tcpclient.go b/transport/protocol/tcp/tcpclient.go index c9ecfe2..30cc965 100644 --- a/transport/protocol/tcp/tcpclient.go +++ b/transport/protocol/tcp/tcpclient.go @@ -4,14 +4,13 @@ import ( "context" "errors" "fmt" + "github.com/net-byte/vtun/common/x/xcrypto" + "github.com/net-byte/vtun/common/x/xproto" + "github.com/net-byte/vtun/common/x/xtun" "log" "net" "time" - "github.com/net-byte/vtun/common/xcrypto" - "github.com/net-byte/vtun/common/xproto" - "github.com/net-byte/vtun/common/xtun" - "github.com/golang/snappy" "github.com/net-byte/vtun/common/cache" "github.com/net-byte/vtun/common/cipher" diff --git a/transport/protocol/tcp/tcpserver.go b/transport/protocol/tcp/tcpserver.go index b99ba24..0935865 100644 --- a/transport/protocol/tcp/tcpserver.go +++ b/transport/protocol/tcp/tcpserver.go @@ -9,8 +9,8 @@ import ( "github.com/net-byte/vtun/common/config" "github.com/net-byte/vtun/common/counter" "github.com/net-byte/vtun/common/netutil" - "github.com/net-byte/vtun/common/xcrypto" - "github.com/net-byte/vtun/common/xproto" + "github.com/net-byte/vtun/common/x/xcrypto" + "github.com/net-byte/vtun/common/x/xproto" "github.com/net-byte/water" "log" "net" diff --git a/transport/protocol/tls/tlsclient.go b/transport/protocol/tls/tlsclient.go index 2f0a9c0..588801c 100644 --- a/transport/protocol/tls/tlsclient.go +++ b/transport/protocol/tls/tlsclient.go @@ -7,7 +7,7 @@ import ( "github.com/net-byte/vtun/common/config" "github.com/net-byte/vtun/common/counter" "github.com/net-byte/vtun/common/netutil" - "github.com/net-byte/vtun/common/xtun" + "github.com/net-byte/vtun/common/x/xtun" "github.com/net-byte/vtun/transport/protocol/tcp" "github.com/net-byte/water" "log" diff --git a/transport/protocol/utls/utlsclient.go b/transport/protocol/utls/utlsclient.go index 89cb319..ece23e2 100644 --- a/transport/protocol/utls/utlsclient.go +++ b/transport/protocol/utls/utlsclient.go @@ -3,7 +3,7 @@ package utls import ( "context" "github.com/net-byte/vtun/common/counter" - "github.com/net-byte/vtun/common/xtun" + "github.com/net-byte/vtun/common/x/xtun" "github.com/net-byte/vtun/transport/protocol/tcp" utls "github.com/refraction-networking/utls" "log" diff --git a/transport/protocol/ws/wsclient.go b/transport/protocol/ws/wsclient.go index 6e87cbe..3230893 100644 --- a/transport/protocol/ws/wsclient.go +++ b/transport/protocol/ws/wsclient.go @@ -2,7 +2,7 @@ package ws import ( "context" - "github.com/net-byte/vtun/common/xtun" + "github.com/net-byte/vtun/common/x/xtun" "log" "net" "time"