diff --git a/Makefile b/Makefile index 33ff929..ab592c9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ BINARY := tun2socks -MODULE := github.com/xjasonlyu/tun2socks +MODULE := github.com/xjasonlyu/tun2socks/v2 BUILD_DIR := build BUILD_TAGS := diff --git a/component/simple-obfs/http.go b/component/simple-obfs/http.go index 9b7eebc..bedf9f4 100644 --- a/component/simple-obfs/http.go +++ b/component/simple-obfs/http.go @@ -9,7 +9,7 @@ import ( "net" "net/http" - "github.com/xjasonlyu/tun2socks/common/pool" + "github.com/xjasonlyu/tun2socks/v2/common/pool" ) // HTTPObfs is shadowsocks http simple-obfs implementation diff --git a/component/simple-obfs/tls.go b/component/simple-obfs/tls.go index 7f57baf..cfdca32 100644 --- a/component/simple-obfs/tls.go +++ b/component/simple-obfs/tls.go @@ -8,7 +8,7 @@ import ( "net" "time" - "github.com/xjasonlyu/tun2socks/common/pool" + "github.com/xjasonlyu/tun2socks/v2/common/pool" ) func init() { diff --git a/constant/metadata.go b/constant/metadata.go index 010c3a9..997a331 100755 --- a/constant/metadata.go +++ b/constant/metadata.go @@ -7,7 +7,7 @@ import ( "net" "strconv" - "github.com/xjasonlyu/tun2socks/transport/socks5" + "github.com/xjasonlyu/tun2socks/v2/transport/socks5" ) const ( diff --git a/core/device/fd/fd_unix.go b/core/device/fd/fd_unix.go index 231a219..a27a66b 100644 --- a/core/device/fd/fd_unix.go +++ b/core/device/fd/fd_unix.go @@ -6,7 +6,7 @@ import ( "fmt" "strconv" - "github.com/xjasonlyu/tun2socks/core/device" + "github.com/xjasonlyu/tun2socks/v2/core/device" "golang.org/x/sys/unix" "gvisor.dev/gvisor/pkg/tcpip/stack" ) diff --git a/core/device/fd/fd_windows.go b/core/device/fd/fd_windows.go index 29c777c..0e7d5a3 100644 --- a/core/device/fd/fd_windows.go +++ b/core/device/fd/fd_windows.go @@ -3,7 +3,7 @@ package fd import ( "errors" - "github.com/xjasonlyu/tun2socks/core/device" + "github.com/xjasonlyu/tun2socks/v2/core/device" ) func Open(name string, mtu uint32) (device.Device, error) { diff --git a/core/device/fd/open_linux.go b/core/device/fd/open_linux.go index b8455e5..5e0db7b 100644 --- a/core/device/fd/open_linux.go +++ b/core/device/fd/open_linux.go @@ -3,7 +3,7 @@ package fd import ( "fmt" - "github.com/xjasonlyu/tun2socks/core/device" + "github.com/xjasonlyu/tun2socks/v2/core/device" "gvisor.dev/gvisor/pkg/tcpip/link/fdbased" ) diff --git a/core/device/fd/open_others.go b/core/device/fd/open_others.go index 0e014c7..be32c3c 100644 --- a/core/device/fd/open_others.go +++ b/core/device/fd/open_others.go @@ -6,8 +6,8 @@ import ( "fmt" "os" - "github.com/xjasonlyu/tun2socks/core/device" - "github.com/xjasonlyu/tun2socks/core/device/rwbased" + "github.com/xjasonlyu/tun2socks/v2/core/device" + "github.com/xjasonlyu/tun2socks/v2/core/device/rwbased" ) func open(fd int, mtu uint32) (device.Device, error) { diff --git a/core/device/tun/io_unix.go b/core/device/tun/io_unix.go index 45c6fef..5fb6a1a 100644 --- a/core/device/tun/io_unix.go +++ b/core/device/tun/io_unix.go @@ -3,7 +3,7 @@ package tun import ( - "github.com/xjasonlyu/tun2socks/common/pool" + "github.com/xjasonlyu/tun2socks/v2/common/pool" ) const ( diff --git a/core/device/tun/tun.go b/core/device/tun/tun.go index c8283f2..9d4b1e3 100755 --- a/core/device/tun/tun.go +++ b/core/device/tun/tun.go @@ -2,7 +2,7 @@ package tun import ( - "github.com/xjasonlyu/tun2socks/core/device" + "github.com/xjasonlyu/tun2socks/v2/core/device" ) const Driver = "tun" diff --git a/core/device/tun/tun_gvisor.go b/core/device/tun/tun_gvisor.go index b00f8da..c57a05e 100755 --- a/core/device/tun/tun_gvisor.go +++ b/core/device/tun/tun_gvisor.go @@ -6,7 +6,7 @@ import ( "fmt" "unsafe" - "github.com/xjasonlyu/tun2socks/core/device" + "github.com/xjasonlyu/tun2socks/v2/core/device" "golang.org/x/sys/unix" "gvisor.dev/gvisor/pkg/tcpip/link/fdbased" diff --git a/core/device/tun/tun_wireguard.go b/core/device/tun/tun_wireguard.go index feeffbd..77218d0 100755 --- a/core/device/tun/tun_wireguard.go +++ b/core/device/tun/tun_wireguard.go @@ -5,8 +5,8 @@ package tun import ( "fmt" - "github.com/xjasonlyu/tun2socks/core/device" - "github.com/xjasonlyu/tun2socks/core/device/rwbased" + "github.com/xjasonlyu/tun2socks/v2/core/device" + "github.com/xjasonlyu/tun2socks/v2/core/device/rwbased" "golang.zx2c4.com/wireguard/tun" ) diff --git a/core/stack/stack.go b/core/stack/stack.go index bafbf2f..84ce4dc 100755 --- a/core/stack/stack.go +++ b/core/stack/stack.go @@ -2,7 +2,7 @@ package stack import ( - "github.com/xjasonlyu/tun2socks/core" + "github.com/xjasonlyu/tun2socks/v2/core" "gvisor.dev/gvisor/pkg/tcpip" "gvisor.dev/gvisor/pkg/tcpip/network/ipv4" diff --git a/engine/engine.go b/engine/engine.go index 2bb0bae..9852ca8 100755 --- a/engine/engine.go +++ b/engine/engine.go @@ -4,13 +4,13 @@ import ( "errors" "os" - "github.com/xjasonlyu/tun2socks/component/dialer" - "github.com/xjasonlyu/tun2socks/core/device" - "github.com/xjasonlyu/tun2socks/core/stack" - "github.com/xjasonlyu/tun2socks/log" - "github.com/xjasonlyu/tun2socks/proxy" - "github.com/xjasonlyu/tun2socks/stats" - "github.com/xjasonlyu/tun2socks/tunnel" + "github.com/xjasonlyu/tun2socks/v2/component/dialer" + "github.com/xjasonlyu/tun2socks/v2/core/device" + "github.com/xjasonlyu/tun2socks/v2/core/stack" + "github.com/xjasonlyu/tun2socks/v2/log" + "github.com/xjasonlyu/tun2socks/v2/proxy" + "github.com/xjasonlyu/tun2socks/v2/stats" + "github.com/xjasonlyu/tun2socks/v2/tunnel" "gopkg.in/yaml.v3" ) diff --git a/engine/parse.go b/engine/parse.go index d0eff29..b8d1293 100644 --- a/engine/parse.go +++ b/engine/parse.go @@ -6,11 +6,11 @@ import ( "net/url" "strings" - "github.com/xjasonlyu/tun2socks/core/device" - "github.com/xjasonlyu/tun2socks/core/device/fd" - "github.com/xjasonlyu/tun2socks/core/device/tun" - "github.com/xjasonlyu/tun2socks/proxy" - "github.com/xjasonlyu/tun2socks/proxy/proto" + "github.com/xjasonlyu/tun2socks/v2/core/device" + "github.com/xjasonlyu/tun2socks/v2/core/device/fd" + "github.com/xjasonlyu/tun2socks/v2/core/device/tun" + "github.com/xjasonlyu/tun2socks/v2/proxy" + "github.com/xjasonlyu/tun2socks/v2/proxy/proto" ) func parseDevice(s string, mtu uint32) (device.Device, error) { diff --git a/engine/tunnel.go b/engine/tunnel.go index b0e223f..336f5aa 100644 --- a/engine/tunnel.go +++ b/engine/tunnel.go @@ -1,8 +1,8 @@ package engine import ( - "github.com/xjasonlyu/tun2socks/core" - "github.com/xjasonlyu/tun2socks/tunnel" + "github.com/xjasonlyu/tun2socks/v2/core" + "github.com/xjasonlyu/tun2socks/v2/tunnel" ) var _ core.Handler = (*fakeTunnel)(nil) diff --git a/engine/version.go b/engine/version.go index 2c1681c..0e32b25 100644 --- a/engine/version.go +++ b/engine/version.go @@ -5,7 +5,7 @@ import ( "runtime" "strings" - V "github.com/xjasonlyu/tun2socks/constant" + V "github.com/xjasonlyu/tun2socks/v2/constant" ) func showVersion() { diff --git a/go.mod b/go.mod index 1fbfcdd..8b62c98 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/xjasonlyu/tun2socks +module github.com/xjasonlyu/tun2socks/v2 go 1.17 diff --git a/log/event.go b/log/event.go index 6930248..e492550 100755 --- a/log/event.go +++ b/log/event.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/xjasonlyu/tun2socks/common/observable" + "github.com/xjasonlyu/tun2socks/v2/common/observable" ) var ( diff --git a/main.go b/main.go index fe23e5d..a31c5cc 100755 --- a/main.go +++ b/main.go @@ -6,8 +6,8 @@ import ( "os/signal" "syscall" - "github.com/xjasonlyu/tun2socks/engine" - "github.com/xjasonlyu/tun2socks/log" + "github.com/xjasonlyu/tun2socks/v2/engine" + "github.com/xjasonlyu/tun2socks/v2/log" ) var key = new(engine.Key) diff --git a/proxy/base.go b/proxy/base.go index 207ca66..bafbdc9 100755 --- a/proxy/base.go +++ b/proxy/base.go @@ -5,8 +5,8 @@ import ( "errors" "net" - M "github.com/xjasonlyu/tun2socks/constant" - "github.com/xjasonlyu/tun2socks/proxy/proto" + M "github.com/xjasonlyu/tun2socks/v2/constant" + "github.com/xjasonlyu/tun2socks/v2/proxy/proto" ) var _ Proxy = (*Base)(nil) diff --git a/proxy/direct.go b/proxy/direct.go index 7899f9b..1a23f32 100755 --- a/proxy/direct.go +++ b/proxy/direct.go @@ -4,9 +4,9 @@ import ( "context" "net" - "github.com/xjasonlyu/tun2socks/component/dialer" - M "github.com/xjasonlyu/tun2socks/constant" - "github.com/xjasonlyu/tun2socks/proxy/proto" + "github.com/xjasonlyu/tun2socks/v2/component/dialer" + M "github.com/xjasonlyu/tun2socks/v2/constant" + "github.com/xjasonlyu/tun2socks/v2/proxy/proto" ) var _ Proxy = (*Direct)(nil) diff --git a/proxy/http.go b/proxy/http.go index e7fc63e..e694d2a 100644 --- a/proxy/http.go +++ b/proxy/http.go @@ -13,9 +13,9 @@ import ( "net/http" "net/url" - "github.com/xjasonlyu/tun2socks/component/dialer" - M "github.com/xjasonlyu/tun2socks/constant" - "github.com/xjasonlyu/tun2socks/proxy/proto" + "github.com/xjasonlyu/tun2socks/v2/component/dialer" + M "github.com/xjasonlyu/tun2socks/v2/constant" + "github.com/xjasonlyu/tun2socks/v2/proxy/proto" ) type HTTP struct { diff --git a/proxy/proxy.go b/proxy/proxy.go index 3b0cdbd..ab1f13d 100755 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -6,8 +6,8 @@ import ( "net" "time" - M "github.com/xjasonlyu/tun2socks/constant" - "github.com/xjasonlyu/tun2socks/proxy/proto" + M "github.com/xjasonlyu/tun2socks/v2/constant" + "github.com/xjasonlyu/tun2socks/v2/proxy/proto" ) const ( diff --git a/proxy/reject.go b/proxy/reject.go index ddfd996..df8f852 100644 --- a/proxy/reject.go +++ b/proxy/reject.go @@ -6,8 +6,8 @@ import ( "net" "time" - M "github.com/xjasonlyu/tun2socks/constant" - "github.com/xjasonlyu/tun2socks/proxy/proto" + M "github.com/xjasonlyu/tun2socks/v2/constant" + "github.com/xjasonlyu/tun2socks/v2/proxy/proto" ) var _ Proxy = (*Reject)(nil) diff --git a/proxy/shadowsocks.go b/proxy/shadowsocks.go index f217d3b..7296aa9 100755 --- a/proxy/shadowsocks.go +++ b/proxy/shadowsocks.go @@ -6,11 +6,11 @@ import ( "fmt" "net" - "github.com/xjasonlyu/tun2socks/component/dialer" - obfs "github.com/xjasonlyu/tun2socks/component/simple-obfs" - M "github.com/xjasonlyu/tun2socks/constant" - "github.com/xjasonlyu/tun2socks/proxy/proto" - "github.com/xjasonlyu/tun2socks/transport/socks5" + "github.com/xjasonlyu/tun2socks/v2/component/dialer" + obfs "github.com/xjasonlyu/tun2socks/v2/component/simple-obfs" + M "github.com/xjasonlyu/tun2socks/v2/constant" + "github.com/xjasonlyu/tun2socks/v2/proxy/proto" + "github.com/xjasonlyu/tun2socks/v2/transport/socks5" "github.com/Dreamacro/go-shadowsocks2/core" ) diff --git a/proxy/socks4.go b/proxy/socks4.go index 9eb0313..4a56254 100644 --- a/proxy/socks4.go +++ b/proxy/socks4.go @@ -5,10 +5,10 @@ import ( "fmt" "net" - "github.com/xjasonlyu/tun2socks/component/dialer" - M "github.com/xjasonlyu/tun2socks/constant" - "github.com/xjasonlyu/tun2socks/proxy/proto" - "github.com/xjasonlyu/tun2socks/transport/socks4" + "github.com/xjasonlyu/tun2socks/v2/component/dialer" + M "github.com/xjasonlyu/tun2socks/v2/constant" + "github.com/xjasonlyu/tun2socks/v2/proxy/proto" + "github.com/xjasonlyu/tun2socks/v2/transport/socks4" ) var _ Proxy = (*Socks4)(nil) diff --git a/proxy/socks5.go b/proxy/socks5.go index 2d9d0ef..a9e1810 100755 --- a/proxy/socks5.go +++ b/proxy/socks5.go @@ -7,10 +7,10 @@ import ( "io" "net" - "github.com/xjasonlyu/tun2socks/component/dialer" - M "github.com/xjasonlyu/tun2socks/constant" - "github.com/xjasonlyu/tun2socks/proxy/proto" - "github.com/xjasonlyu/tun2socks/transport/socks5" + "github.com/xjasonlyu/tun2socks/v2/component/dialer" + M "github.com/xjasonlyu/tun2socks/v2/constant" + "github.com/xjasonlyu/tun2socks/v2/proxy/proto" + "github.com/xjasonlyu/tun2socks/v2/transport/socks5" ) var _ Proxy = (*Socks5)(nil) diff --git a/stats/connections.go b/stats/connections.go index 23250f5..c282bbf 100755 --- a/stats/connections.go +++ b/stats/connections.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - "github.com/xjasonlyu/tun2socks/tunnel/statistic" + "github.com/xjasonlyu/tun2socks/v2/tunnel/statistic" "github.com/go-chi/chi/v5" "github.com/go-chi/render" diff --git a/stats/server.go b/stats/server.go index 4533601..75ced90 100755 --- a/stats/server.go +++ b/stats/server.go @@ -8,9 +8,9 @@ import ( "strings" "time" - V "github.com/xjasonlyu/tun2socks/constant" - "github.com/xjasonlyu/tun2socks/log" - "github.com/xjasonlyu/tun2socks/tunnel/statistic" + V "github.com/xjasonlyu/tun2socks/v2/constant" + "github.com/xjasonlyu/tun2socks/v2/log" + "github.com/xjasonlyu/tun2socks/v2/tunnel/statistic" "github.com/go-chi/chi/v5" "github.com/go-chi/cors" diff --git a/tunnel/statistic/tracker.go b/tunnel/statistic/tracker.go index f5a4155..a5d1283 100755 --- a/tunnel/statistic/tracker.go +++ b/tunnel/statistic/tracker.go @@ -4,7 +4,7 @@ import ( "net" "time" - M "github.com/xjasonlyu/tun2socks/constant" + M "github.com/xjasonlyu/tun2socks/v2/constant" "github.com/gofrs/uuid" "go.uber.org/atomic" diff --git a/tunnel/tcp.go b/tunnel/tcp.go index e0c03b1..f6af101 100755 --- a/tunnel/tcp.go +++ b/tunnel/tcp.go @@ -6,12 +6,12 @@ import ( "sync" "time" - "github.com/xjasonlyu/tun2socks/common/pool" - M "github.com/xjasonlyu/tun2socks/constant" - "github.com/xjasonlyu/tun2socks/core" - "github.com/xjasonlyu/tun2socks/log" - "github.com/xjasonlyu/tun2socks/proxy" - "github.com/xjasonlyu/tun2socks/tunnel/statistic" + "github.com/xjasonlyu/tun2socks/v2/common/pool" + M "github.com/xjasonlyu/tun2socks/v2/constant" + "github.com/xjasonlyu/tun2socks/v2/core" + "github.com/xjasonlyu/tun2socks/v2/log" + "github.com/xjasonlyu/tun2socks/v2/proxy" + "github.com/xjasonlyu/tun2socks/v2/tunnel/statistic" ) const ( diff --git a/tunnel/tunnel.go b/tunnel/tunnel.go index 1402066..d69ff80 100755 --- a/tunnel/tunnel.go +++ b/tunnel/tunnel.go @@ -3,8 +3,8 @@ package tunnel import ( "runtime" - "github.com/xjasonlyu/tun2socks/core" - "github.com/xjasonlyu/tun2socks/log" + "github.com/xjasonlyu/tun2socks/v2/core" + "github.com/xjasonlyu/tun2socks/v2/log" ) const ( diff --git a/tunnel/udp.go b/tunnel/udp.go index 03b3e76..fa80e5b 100755 --- a/tunnel/udp.go +++ b/tunnel/udp.go @@ -6,13 +6,13 @@ import ( "os" "time" - "github.com/xjasonlyu/tun2socks/common/pool" - "github.com/xjasonlyu/tun2socks/component/nat" - M "github.com/xjasonlyu/tun2socks/constant" - "github.com/xjasonlyu/tun2socks/core" - "github.com/xjasonlyu/tun2socks/log" - "github.com/xjasonlyu/tun2socks/proxy" - "github.com/xjasonlyu/tun2socks/tunnel/statistic" + "github.com/xjasonlyu/tun2socks/v2/common/pool" + "github.com/xjasonlyu/tun2socks/v2/component/nat" + M "github.com/xjasonlyu/tun2socks/v2/constant" + "github.com/xjasonlyu/tun2socks/v2/core" + "github.com/xjasonlyu/tun2socks/v2/log" + "github.com/xjasonlyu/tun2socks/v2/proxy" + "github.com/xjasonlyu/tun2socks/v2/tunnel/statistic" ) var (