mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
vless: spport server mode
This commit is contained in:
1 parent
1ed7fbff65
commit
8b6739f12c
15 files changed
+328
-97
No files matched your search
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/nadoo/glider/proxy/socks"
|
||||
)
|
||||
|
||||
// PktConn .
|
||||
// PktConn is a udp Packet.Conn.
|
||||
type PktConn struct {
|
||||
net.Conn
|
||||
|
||||
@@ -58,7 +58,7 @@ func (pc *PktConn) ReadFrom(b []byte) (int, net.Addr, error) {
|
||||
// Payload
|
||||
n, err := io.ReadFull(pc.Conn, b[:length])
|
||||
if err != nil {
|
||||
return 0, nil, err
|
||||
return n, nil, err
|
||||
}
|
||||
|
||||
// TODO: check the addr in return value, it's a fake packetConn so the addr is not valid
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/nadoo/glider/proxy/socks"
|
||||
)
|
||||
|
||||
// Trojan is a base trojan struct
|
||||
// Trojan is a base trojan struct.
|
||||
type Trojan struct {
|
||||
dialer proxy.Dialer
|
||||
proxy proxy.Proxy
|
||||
@@ -67,7 +67,7 @@ func NewTrojan(s string, d proxy.Dialer, p proxy.Proxy) (*Trojan, error) {
|
||||
t.tlsConfig = &tls.Config{
|
||||
ServerName: t.serverName,
|
||||
InsecureSkipVerify: t.skipVerify,
|
||||
NextProtos: []string{"http/1.1", "h2"},
|
||||
NextProtos: []string{"http/1.1"},
|
||||
ClientSessionCache: tls.NewLRUClientSessionCache(64),
|
||||
MinVersion: tls.VersionTLS10,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user