remove anonymous interfaces

This commit is contained in:
Page Fault
2020-05-27 06:28:08 +00:00
parent 872ca954f2
commit c9940e6e31
17 changed files with 4 additions and 45 deletions
-5
View File
@@ -8,9 +8,6 @@ import (
)
type RewindReader struct {
io.Reader
io.ByteReader
rawReader io.Reader
buf []byte
bufReadIdx int
@@ -142,8 +139,6 @@ func NewRewindConn(conn net.Conn) *RewindConn {
}
type StickyWriter struct {
io.Writer
rawWriter io.Writer
writeBuffer []byte
MaxBuffered int
-2
View File
@@ -17,8 +17,6 @@ const (
)
type Address struct {
net.Addr
DomainName string
Port int
NetworkType string
-2
View File
@@ -12,8 +12,6 @@ import (
)
type EasyOption struct {
common.OptionHandler
server *bool
client *bool
password *string
-3
View File
@@ -45,9 +45,6 @@ func parseHTTPRequest(httpRequest *http.Request) *protocol.Request {
}
type HTTPInboundTunnelConnSession struct {
protocol.ConnSession
protocol.NeedRespond
request *protocol.Request
httpRequest *http.Request
bufReader *bufio.Reader
-2
View File
@@ -29,8 +29,6 @@ const (
)
type Request struct {
net.Addr
Command
*common.Address
}
-2
View File
@@ -10,8 +10,6 @@ import (
)
type SimpleSocksConnSession struct {
protocol.ConnSession
request *protocol.Request
rwc io.ReadWriteCloser
recv uint64
-4
View File
@@ -14,8 +14,6 @@ import (
)
type SocksConnInboundSession struct {
protocol.ConnSession
protocol.NeedRespond
request *protocol.Request
rwc *common.RewindReadWriteCloser
}
@@ -117,8 +115,6 @@ type udpSession struct {
}
type SocksInboundPacketSession struct {
protocol.PacketSession
conn *net.UDPConn
sessionTable map[string]*udpSession
tableMutex sync.Mutex
-2
View File
@@ -16,7 +16,6 @@ import (
)
type TProxyInboundConnSession struct {
protocol.ConnSession
reqeust *protocol.Request
conn net.Conn
}
@@ -75,7 +74,6 @@ type udpSession struct {
}
type NATInboundPacketSession struct {
protocol.PacketSession
request *protocol.Request
conn *net.UDPConn
tableMutex sync.Mutex
+1 -3
View File
@@ -14,8 +14,6 @@ import (
)
type TrojanInboundConnSession struct {
protocol.ConnSession
rwc io.ReadWriteCloser
ctx context.Context
config *conf.GlobalConfig
@@ -85,7 +83,7 @@ func (i *TrojanInboundConnSession) parseRequest(r *common.RewindReader) error {
}
func NewInboundConnSession(ctx context.Context, conn net.Conn, config *conf.GlobalConfig, auth stat.Authenticator, shadowMan *shadow.ShadowManager) (protocol.ConnSession, *protocol.Request, error) {
ctx, cancel := context.WithCancel(context.Background())
ctx, cancel := context.WithCancel(ctx)
rewindConn := common.NewRewindConn(conn)
ip, _, err := net.SplitHostPort(conn.RemoteAddr().String())
common.Must(err)
-2
View File
@@ -12,8 +12,6 @@ import (
)
type TrojanOutboundConnSession struct {
protocol.ConnSession
config *conf.GlobalConfig
rwc io.ReadWriteCloser
request *protocol.Request
-1
View File
@@ -10,7 +10,6 @@ import (
)
type TrojanPacketSession struct {
protocol.PacketSession
conn io.ReadWriteCloser
}
-3
View File
@@ -28,9 +28,6 @@ type packetInfo struct {
}
type Client struct {
common.Runnable
proxy.Buildable
config *conf.GlobalConfig
ctx context.Context
cancel context.CancelFunc
-3
View File
@@ -21,9 +21,6 @@ type dispatchInfo struct {
}
type Forward struct {
common.Runnable
proxy.Buildable
config *conf.GlobalConfig
ctx context.Context
cancel context.CancelFunc
-3
View File
@@ -18,9 +18,6 @@ import (
)
type NAT struct {
common.Runnable
proxy.Buildable
config *conf.GlobalConfig
ctx context.Context
cancel context.CancelFunc
-1
View File
@@ -11,7 +11,6 @@ import (
)
type Relay struct {
common.Runnable
config *conf.GlobalConfig
ctx context.Context
cancel context.CancelFunc
-3
View File
@@ -22,9 +22,6 @@ import (
)
type Server struct {
common.Runnable
proxy.Buildable
listener net.Listener
auth stat.Authenticator
config *conf.GlobalConfig
+3 -4
View File
@@ -9,8 +9,7 @@ import (
)
type versionOption struct {
arg *bool
common.OptionHandler
flag *bool
}
func (*versionOption) Name() string {
@@ -22,7 +21,7 @@ func (*versionOption) Priority() int {
}
func (c *versionOption) Handle() error {
if *c.arg {
if *c.flag {
fmt.Println("Trojan-Go", common.Version, fmt.Sprintf("(%s %s/%s)", runtime.Version(), runtime.GOOS, runtime.GOARCH))
fmt.Println("Developed by PageFault (p4gefau1t)")
fmt.Println("Lisensed under GNU General Public License v3")
@@ -35,6 +34,6 @@ func (c *versionOption) Handle() error {
func init() {
common.RegisterOptionHandler(&versionOption{
arg: flag.Bool("version", false, "Display version and help info"),
flag: flag.Bool("version", false, "Display version and help info"),
})
}