Browse Source

Fix: set major version to v2 (#88)

pull/133/head
Fan Lin 3 years ago
committed by GitHub
parent
commit
c068fbd626
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Makefile
  2. 2
      component/simple-obfs/http.go
  3. 2
      component/simple-obfs/tls.go
  4. 2
      constant/metadata.go
  5. 2
      core/device/fd/fd_unix.go
  6. 2
      core/device/fd/fd_windows.go
  7. 2
      core/device/fd/open_linux.go
  8. 4
      core/device/fd/open_others.go
  9. 2
      core/device/tun/io_unix.go
  10. 2
      core/device/tun/tun.go
  11. 2
      core/device/tun/tun_gvisor.go
  12. 4
      core/device/tun/tun_wireguard.go
  13. 2
      core/stack/stack.go
  14. 14
      engine/engine.go
  15. 10
      engine/parse.go
  16. 4
      engine/tunnel.go
  17. 2
      engine/version.go
  18. 2
      go.mod
  19. 2
      log/event.go
  20. 4
      main.go
  21. 4
      proxy/base.go
  22. 6
      proxy/direct.go
  23. 6
      proxy/http.go
  24. 4
      proxy/proxy.go
  25. 4
      proxy/reject.go
  26. 10
      proxy/shadowsocks.go
  27. 8
      proxy/socks4.go
  28. 8
      proxy/socks5.go
  29. 2
      stats/connections.go
  30. 6
      stats/server.go
  31. 2
      tunnel/statistic/tracker.go
  32. 12
      tunnel/tcp.go
  33. 4
      tunnel/tunnel.go
  34. 14
      tunnel/udp.go

2
Makefile

@ -1,5 +1,5 @@
BINARY := tun2socks
MODULE := github.com/xjasonlyu/tun2socks
MODULE := github.com/xjasonlyu/tun2socks/v2
BUILD_DIR := build
BUILD_TAGS :=

2
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

2
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() {

2
constant/metadata.go

@ -7,7 +7,7 @@ import (
"net"
"strconv"
"github.com/xjasonlyu/tun2socks/transport/socks5"
"github.com/xjasonlyu/tun2socks/v2/transport/socks5"
)
const (

2
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"
)

2
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) {

2
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"
)

4
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) {

2
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 (

2
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"

2
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"

4
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"
)

2
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"

14
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"
)

10
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) {

4
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)

2
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() {

2
go.mod

@ -1,4 +1,4 @@
module github.com/xjasonlyu/tun2socks
module github.com/xjasonlyu/tun2socks/v2
go 1.17

2
log/event.go

@ -4,7 +4,7 @@ import (
"fmt"
"time"
"github.com/xjasonlyu/tun2socks/common/observable"
"github.com/xjasonlyu/tun2socks/v2/common/observable"
)
var (

4
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)

4
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)

6
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)

6
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 {

4
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 (

4
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)

10
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"
)

8
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)

8
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)

2
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"

6
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"

2
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"

12
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 (

4
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 (

14
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 (

Loading…
Cancel
Save