mirror of
https://github.com/p4gefau1t/trojan-go.git
synced 2024-04-21 12:21:34 +00:00
Chore: refine go import (#291)
This commit is contained in:
@@ -7,11 +7,12 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/api/service"
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/option"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type apiController struct {
|
||||
|
||||
@@ -6,10 +6,11 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/statistic/memory"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
func TestClientAPI(t *testing.T) {
|
||||
|
||||
@@ -8,14 +8,15 @@ import (
|
||||
"io/ioutil"
|
||||
"net"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/api"
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/statistic"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/trojan"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
)
|
||||
|
||||
type ServerAPI struct {
|
||||
|
||||
@@ -9,11 +9,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/statistic/memory"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
)
|
||||
|
||||
func TestServerAPI(t *testing.T) {
|
||||
|
||||
+1
-2
@@ -6,10 +6,9 @@ import (
|
||||
"net"
|
||||
"strconv"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/option"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/option"
|
||||
"github.com/p4gefau1t/trojan-go/proxy"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,8 +8,9 @@ package colorful
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/log/golog/buffer"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/log/golog/buffer"
|
||||
)
|
||||
|
||||
func TestColorBuffer(t *testing.T) {
|
||||
|
||||
+2
-1
@@ -12,9 +12,10 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/log/golog/colorful"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -3,10 +3,9 @@ package main
|
||||
import (
|
||||
"flag"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/option"
|
||||
|
||||
_ "github.com/p4gefau1t/trojan-go/component"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/option"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -4,11 +4,12 @@ import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/proxy"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
func convert(i interface{}) interface{} {
|
||||
|
||||
@@ -6,13 +6,12 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"golang.org/x/time/rate"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/statistic"
|
||||
"golang.org/x/time/rate"
|
||||
)
|
||||
|
||||
const Name = "MEMORY"
|
||||
|
||||
@@ -6,13 +6,12 @@ import (
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/test/util"
|
||||
|
||||
_ "net/http/pprof"
|
||||
netproxy "golang.org/x/net/proxy"
|
||||
|
||||
_ "github.com/p4gefau1t/trojan-go/api"
|
||||
_ "github.com/p4gefau1t/trojan-go/api/service"
|
||||
@@ -24,7 +23,7 @@ import (
|
||||
_ "github.com/p4gefau1t/trojan-go/proxy/nat"
|
||||
_ "github.com/p4gefau1t/trojan-go/proxy/server"
|
||||
_ "github.com/p4gefau1t/trojan-go/statistic/memory"
|
||||
netproxy "golang.org/x/net/proxy"
|
||||
"github.com/p4gefau1t/trojan-go/test/util"
|
||||
)
|
||||
|
||||
// test key and cert
|
||||
|
||||
+2
-1
@@ -10,9 +10,10 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/websocket"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"golang.org/x/net/websocket"
|
||||
)
|
||||
|
||||
var HTTPAddr string
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"net"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,11 +4,12 @@ import (
|
||||
"context"
|
||||
"net"
|
||||
|
||||
"github.com/txthinking/socks5"
|
||||
"golang.org/x/net/proxy"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/txthinking/socks5"
|
||||
"golang.org/x/net/proxy"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
|
||||
@@ -4,10 +4,11 @@ import (
|
||||
"bytes"
|
||||
"net"
|
||||
|
||||
"github.com/txthinking/socks5"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/txthinking/socks5"
|
||||
)
|
||||
|
||||
const MaxPacketSize = 1024 * 8
|
||||
|
||||
@@ -7,10 +7,11 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/txthinking/socks5"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/test/util"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/txthinking/socks5"
|
||||
)
|
||||
|
||||
func TestConn(t *testing.T) {
|
||||
|
||||
@@ -7,11 +7,12 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/xtaci/smux"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/xtaci/smux"
|
||||
)
|
||||
|
||||
type muxID uint32
|
||||
|
||||
@@ -4,12 +4,11 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/freedom"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/transport"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/test/util"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/freedom"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/transport"
|
||||
)
|
||||
|
||||
func TestMux(t *testing.T) {
|
||||
|
||||
@@ -3,10 +3,11 @@ package mux
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/xtaci/smux"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/xtaci/smux"
|
||||
)
|
||||
|
||||
// Server is a smux server
|
||||
|
||||
@@ -9,13 +9,14 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
v2router "github.com/v2fly/v2ray-core/v4/app/router"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/freedom"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/transport"
|
||||
v2router "github.com/v2fly/v2ray-core/v4/app/router"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -3,11 +3,12 @@ package shadowsocks
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/shadowsocks/go-shadowsocks2/core"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/shadowsocks/go-shadowsocks2/core"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
|
||||
@@ -4,12 +4,13 @@ import (
|
||||
"context"
|
||||
"net"
|
||||
|
||||
"github.com/shadowsocks/go-shadowsocks2/core"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/redirector"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/shadowsocks/go-shadowsocks2/core"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
|
||||
@@ -10,14 +10,15 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/txthinking/socks5"
|
||||
"golang.org/x/net/proxy"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/test/util"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/adapter"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/socks"
|
||||
"github.com/txthinking/socks5"
|
||||
"golang.org/x/net/proxy"
|
||||
)
|
||||
|
||||
func TestSocks(t *testing.T) {
|
||||
|
||||
@@ -9,13 +9,14 @@ import (
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
utls "github.com/refraction-networking/utls"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/tls/fingerprint"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/transport"
|
||||
utls "github.com/refraction-networking/utls"
|
||||
)
|
||||
|
||||
// Client is a tls client
|
||||
|
||||
@@ -6,11 +6,10 @@ import (
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/freedom"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/test/util"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/freedom"
|
||||
)
|
||||
|
||||
func TestTransport(t *testing.T) {
|
||||
|
||||
@@ -7,14 +7,13 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/api"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/statistic/memory"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/mux"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/statistic"
|
||||
"github.com/p4gefau1t/trojan-go/statistic/memory"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/mux"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,9 +7,8 @@ import (
|
||||
"io/ioutil"
|
||||
"net"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,14 +7,13 @@ import (
|
||||
"net"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/api"
|
||||
"github.com/p4gefau1t/trojan-go/statistic/memory"
|
||||
"github.com/p4gefau1t/trojan-go/statistic/mysql"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/redirector"
|
||||
"github.com/p4gefau1t/trojan-go/statistic"
|
||||
"github.com/p4gefau1t/trojan-go/statistic/memory"
|
||||
"github.com/p4gefau1t/trojan-go/statistic/mysql"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/mux"
|
||||
)
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/statistic/memory"
|
||||
_ "github.com/p4gefau1t/trojan-go/statistic/memory"
|
||||
"github.com/p4gefau1t/trojan-go/test/util"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/freedom"
|
||||
|
||||
@@ -4,11 +4,12 @@ import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/net/websocket"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"golang.org/x/net/websocket"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
|
||||
@@ -4,8 +4,9 @@ import (
|
||||
"context"
|
||||
"net"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"golang.org/x/net/websocket"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
)
|
||||
|
||||
type OutboundConn struct {
|
||||
|
||||
@@ -9,12 +9,13 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/websocket"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/log"
|
||||
"github.com/p4gefau1t/trojan-go/redirector"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"golang.org/x/net/websocket"
|
||||
)
|
||||
|
||||
// Fake response writer
|
||||
|
||||
@@ -9,13 +9,14 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/websocket"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/config"
|
||||
"github.com/p4gefau1t/trojan-go/test/util"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/freedom"
|
||||
"github.com/p4gefau1t/trojan-go/tunnel/transport"
|
||||
"golang.org/x/net/websocket"
|
||||
)
|
||||
|
||||
func TestWebsocket(t *testing.T) {
|
||||
|
||||
+1
-2
@@ -5,10 +5,9 @@ import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
"github.com/p4gefau1t/trojan-go/constant"
|
||||
"github.com/p4gefau1t/trojan-go/option"
|
||||
|
||||
"github.com/p4gefau1t/trojan-go/common"
|
||||
)
|
||||
|
||||
type versionOption struct {
|
||||
|
||||
Reference in New Issue
Block a user