mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 01:15:41 +08:00
chore: move some packages to pkg folder
This commit is contained in:
parent
a529261893
commit
1fd59a1677
@ -23,7 +23,7 @@ builds:
|
|||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
# GOOS list to build for.
|
# GOOS list to build for.
|
||||||
# For more info refer to: https://golang.org/doc/install/source#environment
|
# For more info refer to: https://go.dev/doc/install/source#environment
|
||||||
# Defaults are darwin and linux.
|
# Defaults are darwin and linux.
|
||||||
goos:
|
goos:
|
||||||
- windows
|
- windows
|
||||||
@ -39,6 +39,7 @@ builds:
|
|||||||
- mipsle
|
- mipsle
|
||||||
- mips64
|
- mips64
|
||||||
- mips64le
|
- mips64le
|
||||||
|
- riscv64
|
||||||
goarm:
|
goarm:
|
||||||
- 6
|
- 6
|
||||||
- 7
|
- 7
|
||||||
@ -53,7 +54,7 @@ archives:
|
|||||||
- default
|
- default
|
||||||
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
|
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
|
||||||
replacements:
|
replacements:
|
||||||
darwin: mac
|
darwin: macos
|
||||||
wrap_in_directory: true
|
wrap_in_directory: true
|
||||||
format: tar.gz
|
format: tar.gz
|
||||||
format_overrides:
|
format_overrides:
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"github.com/nadoo/conflag"
|
"github.com/nadoo/conflag"
|
||||||
|
|
||||||
"github.com/nadoo/glider/dns"
|
"github.com/nadoo/glider/dns"
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/rule"
|
"github.com/nadoo/glider/rule"
|
||||||
)
|
)
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
2
go.mod
2
go.mod
@ -26,7 +26,7 @@ require (
|
|||||||
github.com/templexxx/xorsimd v0.4.1 // indirect
|
github.com/templexxx/xorsimd v0.4.1 // indirect
|
||||||
github.com/tjfoc/gmsm v1.4.1 // indirect
|
github.com/tjfoc/gmsm v1.4.1 // indirect
|
||||||
github.com/u-root/uio v0.0.0-20210528151154-e40b768296a7 // indirect
|
github.com/u-root/uio v0.0.0-20210528151154-e40b768296a7 // indirect
|
||||||
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect
|
golang.org/x/net v0.0.0-20220107192237-5cfca573fb4d // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
// Replace dependency modules with local developing copy
|
// Replace dependency modules with local developing copy
|
||||||
|
4
go.sum
4
go.sum
@ -130,8 +130,8 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R
|
|||||||
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM=
|
golang.org/x/net v0.0.0-20220107192237-5cfca573fb4d h1:62NvYBuaanGXR2ZOfwDFkhhl6X1DUgf8qg3GuQvxZsE=
|
||||||
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20220107192237-5cfca573fb4d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
2
main.go
2
main.go
@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/nadoo/glider/dns"
|
"github.com/nadoo/glider/dns"
|
||||||
"github.com/nadoo/glider/ipset"
|
"github.com/nadoo/glider/ipset"
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/rule"
|
"github.com/nadoo/glider/rule"
|
||||||
"github.com/nadoo/glider/service"
|
"github.com/nadoo/glider/service"
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
@ -8,7 +8,7 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Stream implements net.Conn
|
// Stream implements net.Conn
|
16
pkg/sockopt/bind_linux.go
Normal file
16
pkg/sockopt/bind_linux.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package sockopt
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
|
)
|
||||||
|
|
||||||
|
func BindControl(iface *net.Interface) func(network, address string, c syscall.RawConn) error {
|
||||||
|
return func(network, address string, c syscall.RawConn) error {
|
||||||
|
return c.Control(func(fd uintptr) {
|
||||||
|
unix.BindToDevice(int(fd), iface.Name)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
11
pkg/sockopt/bind_others.go
Normal file
11
pkg/sockopt/bind_others.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
//go:build !linux
|
||||||
|
// +build !linux
|
||||||
|
|
||||||
|
package sockopt
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
"syscall"
|
||||||
|
)
|
||||||
|
|
||||||
|
func BindControl(iface *net.Interface) func(string, string, syscall.RawConn) error { return nil }
|
@ -1,14 +0,0 @@
|
|||||||
package proxy
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net"
|
|
||||||
"syscall"
|
|
||||||
)
|
|
||||||
|
|
||||||
func bind(dialer *net.Dialer, iface *net.Interface) {
|
|
||||||
dialer.Control = func(network, address string, c syscall.RawConn) error {
|
|
||||||
return c.Control(func(fd uintptr) {
|
|
||||||
syscall.BindToDevice(int(fd), iface.Name)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
//go:build !linux
|
|
||||||
// +build !linux
|
|
||||||
|
|
||||||
package proxy
|
|
||||||
|
|
||||||
import "net"
|
|
||||||
|
|
||||||
func bind(dialer *net.Dialer, iface *net.Interface) {}
|
|
@ -10,7 +10,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
package proxy
|
package proxy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
|
"github.com/nadoo/glider/pkg/sockopt"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Direct proxy.
|
// Direct proxy.
|
||||||
@ -86,7 +88,7 @@ func (d *Direct) dial(network, addr string, localIP net.IP) (net.Conn, error) {
|
|||||||
|
|
||||||
dialer := &net.Dialer{LocalAddr: la, Timeout: d.dialTimeout}
|
dialer := &net.Dialer{LocalAddr: la, Timeout: d.dialTimeout}
|
||||||
if d.iface != nil {
|
if d.iface != nil {
|
||||||
bind(dialer, d.iface)
|
dialer.Control = sockopt.BindControl(d.iface)
|
||||||
}
|
}
|
||||||
|
|
||||||
c, err := dialer.Dial(network, addr)
|
c, err := dialer.Dial(network, addr)
|
||||||
@ -107,13 +109,17 @@ func (d *Direct) dial(network, addr string, localIP net.IP) (net.Conn, error) {
|
|||||||
|
|
||||||
// DialUDP connects to the given address.
|
// DialUDP connects to the given address.
|
||||||
func (d *Direct) DialUDP(network, addr string) (net.PacketConn, net.Addr, error) {
|
func (d *Direct) DialUDP(network, addr string) (net.PacketConn, net.Addr, error) {
|
||||||
// TODO: support specifying local interface
|
|
||||||
var la string
|
var la string
|
||||||
if d.ip != nil {
|
if d.ip != nil {
|
||||||
la = net.JoinHostPort(d.ip.String(), "0")
|
la = net.JoinHostPort(d.ip.String(), "0")
|
||||||
}
|
}
|
||||||
|
|
||||||
pc, err := net.ListenPacket(network, la)
|
lc := &net.ListenConfig{}
|
||||||
|
if d.iface != nil {
|
||||||
|
lc.Control = sockopt.BindControl(d.iface)
|
||||||
|
}
|
||||||
|
|
||||||
|
pc, err := lc.ListenPacket(context.Background(), network, la)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.F("ListenPacket error: %s", err)
|
log.F("ListenPacket error: %s", err)
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/textproto"
|
"net/textproto"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Methods are http methods from rfc.
|
// Methods are http methods from rfc.
|
||||||
|
@ -8,8 +8,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
kcp "github.com/xtaci/kcp-go/v5"
|
kcp "github.com/xtaci/kcp-go/v5"
|
||||||
"golang.org/x/crypto/pbkdf2"
|
"golang.org/x/crypto/pbkdf2"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/proxy/http"
|
"github.com/nadoo/glider/proxy/http"
|
||||||
"github.com/nadoo/glider/proxy/socks5"
|
"github.com/nadoo/glider/proxy/socks5"
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HTTPObfs struct
|
// HTTPObfs struct
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,10 +6,9 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
|
"github.com/nadoo/glider/pkg/smux"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
|
|
||||||
"github.com/nadoo/glider/proxy/protocol/smux"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// SmuxClient struct.
|
// SmuxClient struct.
|
||||||
|
@ -5,10 +5,9 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
|
"github.com/nadoo/glider/pkg/smux"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
|
|
||||||
"github.com/nadoo/glider/proxy/protocol/smux"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// SmuxServer struct.
|
// SmuxServer struct.
|
||||||
|
@ -11,8 +11,8 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
|
"github.com/nadoo/glider/pkg/socks"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/proxy/protocol/socks"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewSocks5Dialer returns a socks5 proxy dialer.
|
// NewSocks5Dialer returns a socks5 proxy dialer.
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy/protocol/socks"
|
"github.com/nadoo/glider/pkg/socks"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PktConn .
|
// PktConn .
|
||||||
|
@ -8,10 +8,10 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
|
"github.com/nadoo/glider/pkg/socks"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/proxy/protocol/socks"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var nm sync.Map
|
var nm sync.Map
|
||||||
|
@ -12,7 +12,7 @@ package socks5
|
|||||||
import (
|
import (
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"crypto/cipher"
|
"crypto/cipher"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
const bufSize = 32 * 1024
|
const bufSize = 32 * 1024
|
||||||
|
@ -4,9 +4,9 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
|
"github.com/nadoo/glider/pkg/socks"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/proxy/protocol/socks"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewSSDialer returns a ss proxy dialer.
|
// NewSSDialer returns a ss proxy dialer.
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy/protocol/socks"
|
"github.com/nadoo/glider/pkg/socks"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PktConn .
|
// PktConn .
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
|
"github.com/nadoo/glider/pkg/socks"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/proxy/protocol/socks"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var nm sync.Map
|
var nm sync.Map
|
||||||
|
@ -3,7 +3,7 @@ package ss
|
|||||||
import (
|
import (
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/proxy/ss/cipher"
|
"github.com/nadoo/glider/proxy/ss/cipher"
|
||||||
)
|
)
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
"golang.org/x/crypto/cast5"
|
"golang.org/x/crypto/cast5"
|
||||||
"golang.org/x/crypto/salsa20/salsa"
|
"golang.org/x/crypto/salsa20/salsa"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy/ssr/internal/tools"
|
"github.com/nadoo/glider/proxy/ssr/internal/tools"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/proxy/ssr/internal/cipher"
|
"github.com/nadoo/glider/proxy/ssr/internal/cipher"
|
||||||
"github.com/nadoo/glider/proxy/ssr/internal/obfs"
|
"github.com/nadoo/glider/proxy/ssr/internal/obfs"
|
||||||
|
@ -7,9 +7,9 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
|
"github.com/nadoo/glider/pkg/socks"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/proxy/protocol/socks"
|
|
||||||
|
|
||||||
"github.com/nadoo/glider/proxy/ssr/internal"
|
"github.com/nadoo/glider/proxy/ssr/internal"
|
||||||
"github.com/nadoo/glider/proxy/ssr/internal/cipher"
|
"github.com/nadoo/glider/proxy/ssr/internal/cipher"
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
|
"github.com/nadoo/glider/pkg/socks"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/proxy/protocol/socks"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewClearTextDialer returns a trojan cleartext proxy dialer.
|
// NewClearTextDialer returns a trojan cleartext proxy dialer.
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy/protocol/socks"
|
"github.com/nadoo/glider/pkg/socks"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PktConn is a udp Packet.Conn.
|
// PktConn is a udp Packet.Conn.
|
||||||
|
@ -10,10 +10,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
|
"github.com/nadoo/glider/pkg/socks"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
"github.com/nadoo/glider/proxy/protocol/socks"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewClearTextServer returns a trojan cleartext proxy server.
|
// NewClearTextServer returns a trojan cleartext proxy server.
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Atyp is vless addr type.
|
// Atyp is vless addr type.
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PktConn is a udp Packet.Conn.
|
// PktConn is a udp Packet.Conn.
|
||||||
|
@ -8,8 +8,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
type aeadWriter struct {
|
type aeadWriter struct {
|
||||||
|
@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
"golang.org/x/crypto/chacha20poly1305"
|
"golang.org/x/crypto/chacha20poly1305"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Request Options
|
// Request Options
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
// User of vmess client.
|
// User of vmess client.
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"net/textproto"
|
"net/textproto"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
"net/textproto"
|
"net/textproto"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/pool"
|
"github.com/nadoo/glider/pkg/pool"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/proxy"
|
"github.com/nadoo/glider/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/insomniacslk/dhcp/dhcpv4/nclient4"
|
"github.com/insomniacslk/dhcp/dhcpv4/nclient4"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func existsServer(iface string) (exists bool) {
|
func existsServer(iface string) (exists bool) {
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/insomniacslk/dhcp/dhcpv4"
|
"github.com/insomniacslk/dhcp/dhcpv4"
|
||||||
"github.com/insomniacslk/dhcp/dhcpv4/server4"
|
"github.com/insomniacslk/dhcp/dhcpv4/server4"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
"github.com/nadoo/glider/service"
|
"github.com/nadoo/glider/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ package service
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nadoo/glider/log"
|
"github.com/nadoo/glider/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Service is a server that can be run.
|
// Service is a server that can be run.
|
||||||
|
Loading…
Reference in New Issue
Block a user