Chore: split component to transport

This commit is contained in:
Dreamacro 2021-05-13 22:18:49 +08:00
parent 3c54f99fea
commit f96ebab99f
57 changed files with 34 additions and 35 deletions

View File

@ -1,8 +1,8 @@
package inbound
import (
"github.com/Dreamacro/clash/component/socks5"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/transport/socks5"
)
// PacketAdapter is a UDP Packet adapter for socks/redir/tun

View File

@ -3,9 +3,9 @@ package inbound
import (
"net"
"github.com/Dreamacro/clash/component/socks5"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/context"
"github.com/Dreamacro/clash/transport/socks5"
)
// NewSocket receive TCP inbound and return ConnContext

View File

@ -6,8 +6,8 @@ import (
"strconv"
"strings"
"github.com/Dreamacro/clash/component/socks5"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/transport/socks5"
)
func parseSocksAddr(target socks5.Addr) *C.Metadata {

View File

@ -10,10 +10,10 @@ import (
"github.com/Dreamacro/clash/common/structure"
"github.com/Dreamacro/clash/component/dialer"
obfs "github.com/Dreamacro/clash/component/simple-obfs"
"github.com/Dreamacro/clash/component/socks5"
v2rayObfs "github.com/Dreamacro/clash/component/v2ray-plugin"
C "github.com/Dreamacro/clash/constant"
obfs "github.com/Dreamacro/clash/transport/simple-obfs"
"github.com/Dreamacro/clash/transport/socks5"
v2rayObfs "github.com/Dreamacro/clash/transport/v2ray-plugin"
"github.com/Dreamacro/go-shadowsocks2/core"
)

View File

@ -8,9 +8,9 @@ import (
"strconv"
"github.com/Dreamacro/clash/component/dialer"
"github.com/Dreamacro/clash/component/ssr/obfs"
"github.com/Dreamacro/clash/component/ssr/protocol"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/transport/ssr/obfs"
"github.com/Dreamacro/clash/transport/ssr/protocol"
"github.com/Dreamacro/go-shadowsocks2/core"
"github.com/Dreamacro/go-shadowsocks2/shadowaead"

View File

@ -8,9 +8,9 @@ import (
"github.com/Dreamacro/clash/common/structure"
"github.com/Dreamacro/clash/component/dialer"
obfs "github.com/Dreamacro/clash/component/simple-obfs"
"github.com/Dreamacro/clash/component/snell"
C "github.com/Dreamacro/clash/constant"
obfs "github.com/Dreamacro/clash/transport/simple-obfs"
"github.com/Dreamacro/clash/transport/snell"
)
type Snell struct {

View File

@ -11,8 +11,8 @@ import (
"strconv"
"github.com/Dreamacro/clash/component/dialer"
"github.com/Dreamacro/clash/component/socks5"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/transport/socks5"
)
type Socks5 struct {

View File

@ -9,9 +9,9 @@ import (
"strconv"
"github.com/Dreamacro/clash/component/dialer"
"github.com/Dreamacro/clash/component/gun"
"github.com/Dreamacro/clash/component/trojan"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/transport/gun"
"github.com/Dreamacro/clash/transport/trojan"
"golang.org/x/net/http2"
)

View File

@ -11,8 +11,8 @@ import (
"time"
"github.com/Dreamacro/clash/component/resolver"
"github.com/Dreamacro/clash/component/socks5"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/transport/socks5"
)
const (

View File

@ -11,10 +11,10 @@ import (
"strings"
"github.com/Dreamacro/clash/component/dialer"
"github.com/Dreamacro/clash/component/gun"
"github.com/Dreamacro/clash/component/resolver"
"github.com/Dreamacro/clash/component/vmess"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/transport/gun"
"github.com/Dreamacro/clash/transport/vmess"
"golang.org/x/net/http2"
)

View File

@ -5,11 +5,10 @@ import (
"time"
"github.com/Dreamacro/clash/common/cache"
"github.com/Dreamacro/clash/component/socks5"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/proxy/http"
"github.com/Dreamacro/clash/proxy/socks"
"github.com/Dreamacro/clash/transport/socks5"
)
type MixedListener struct {

View File

@ -5,7 +5,7 @@ import (
"syscall"
"unsafe"
"github.com/Dreamacro/clash/component/socks5"
"github.com/Dreamacro/clash/transport/socks5"
)
func parserPacket(c net.Conn) (socks5.Addr, error) {

View File

@ -4,9 +4,9 @@ import (
"net"
"github.com/Dreamacro/clash/adapters/inbound"
"github.com/Dreamacro/clash/component/socks5"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/transport/socks5"
"github.com/Dreamacro/clash/tunnel"
)

View File

@ -5,8 +5,8 @@ import (
adapters "github.com/Dreamacro/clash/adapters/inbound"
"github.com/Dreamacro/clash/common/pool"
"github.com/Dreamacro/clash/component/socks5"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/transport/socks5"
"github.com/Dreamacro/clash/tunnel"
)

View File

@ -6,10 +6,10 @@ import (
"net"
adapters "github.com/Dreamacro/clash/adapters/inbound"
"github.com/Dreamacro/clash/component/socks5"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log"
authStore "github.com/Dreamacro/clash/proxy/auth"
"github.com/Dreamacro/clash/transport/socks5"
"github.com/Dreamacro/clash/tunnel"
)

View File

@ -6,9 +6,9 @@ import (
adapters "github.com/Dreamacro/clash/adapters/inbound"
"github.com/Dreamacro/clash/common/pool"
"github.com/Dreamacro/clash/common/sockopt"
"github.com/Dreamacro/clash/component/socks5"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/transport/socks5"
"github.com/Dreamacro/clash/tunnel"
)

View File

@ -4,7 +4,7 @@ import (
"net"
"github.com/Dreamacro/clash/common/pool"
"github.com/Dreamacro/clash/component/socks5"
"github.com/Dreamacro/clash/transport/socks5"
)
type packet struct {

View File

@ -10,7 +10,7 @@ import (
"strings"
"github.com/Dreamacro/clash/common/pool"
"github.com/Dreamacro/clash/component/ssr/tools"
"github.com/Dreamacro/clash/transport/ssr/tools"
)
func init() {

View File

@ -10,7 +10,7 @@ import (
"time"
"github.com/Dreamacro/clash/common/pool"
"github.com/Dreamacro/clash/component/ssr/tools"
"github.com/Dreamacro/clash/transport/ssr/tools"
)
func init() {

View File

@ -1,6 +1,6 @@
package protocol
import "github.com/Dreamacro/clash/component/ssr/tools"
import "github.com/Dreamacro/clash/transport/ssr/tools"
func init() {
register("auth_aes128_md5", newAuthAES128MD5, 9)

View File

@ -10,8 +10,8 @@ import (
"strings"
"github.com/Dreamacro/clash/common/pool"
"github.com/Dreamacro/clash/component/ssr/tools"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/transport/ssr/tools"
)
type hmacMethod func(key, data []byte) []byte

View File

@ -12,8 +12,8 @@ import (
"strings"
"github.com/Dreamacro/clash/common/pool"
"github.com/Dreamacro/clash/component/ssr/tools"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/transport/ssr/tools"
"github.com/Dreamacro/go-shadowsocks2/core"
)

View File

@ -4,7 +4,7 @@ import (
"net"
"sort"
"github.com/Dreamacro/clash/component/ssr/tools"
"github.com/Dreamacro/clash/transport/ssr/tools"
)
func init() {

View File

@ -9,7 +9,7 @@ import (
"net"
"github.com/Dreamacro/clash/common/pool"
"github.com/Dreamacro/clash/component/ssr/tools"
"github.com/Dreamacro/clash/transport/ssr/tools"
)
func init() {

View File

@ -4,7 +4,7 @@ import (
"bytes"
"net"
"github.com/Dreamacro/clash/component/ssr/tools"
"github.com/Dreamacro/clash/transport/ssr/tools"
)
type PacketConn struct {

View File

@ -5,7 +5,7 @@ import (
"net"
"github.com/Dreamacro/clash/common/pool"
"github.com/Dreamacro/clash/component/ssr/tools"
"github.com/Dreamacro/clash/transport/ssr/tools"
)
type Conn struct {

View File

@ -11,7 +11,7 @@ import (
"net"
"sync"
"github.com/Dreamacro/clash/component/socks5"
"github.com/Dreamacro/clash/transport/socks5"
)
const (

View File

@ -5,7 +5,7 @@ import (
"net"
"net/http"
"github.com/Dreamacro/clash/component/vmess"
"github.com/Dreamacro/clash/transport/vmess"
)
// Option is options of websocket obfs