Chore: some chores

This commit is contained in:
Dreamacro 2021-04-05 13:31:10 +08:00
parent 42e21b3733
commit 3aefa1d924
4 changed files with 3 additions and 4 deletions

View File

@ -57,4 +57,3 @@ This software is released under the GPL-3.0 license.
- [x] Redir proxy - [x] Redir proxy
- [x] UDP support - [x] UDP support
- [x] Connection manager - [x] Connection manager
- [ ] ~~Event API~~

View File

@ -167,7 +167,7 @@ func NewHTTP2Client(dialFn DialFn, tlsConfig *tls.Config) *http2.Transport {
state := cn.ConnectionState() state := cn.ConnectionState()
if p := state.NegotiatedProtocol; p != http2.NextProtoTLS { if p := state.NegotiatedProtocol; p != http2.NextProtoTLS {
cn.Close() cn.Close()
return nil, errors.New("http2: unexpected ALPN protocol " + p + "; want q" + http2.NextProtoTLS) return nil, fmt.Errorf("http2: unexpected ALPN protocol %s, want %s", p, http2.NextProtoTLS)
} }
return cn, nil return cn, nil
} }

View File

@ -75,5 +75,5 @@ func handleRedirUDP(pc net.PacketConn, buf []byte, lAddr *net.UDPAddr, rAddr *ne
lAddr: lAddr, lAddr: lAddr,
buf: buf, buf: buf,
} }
tunnel.AddPacket(adapters.NewPacket(target, pkt, C.REDIR)) tunnel.AddPacket(adapters.NewPacket(target, pkt, C.TPROXY))
} }

View File

@ -335,7 +335,7 @@ func match(metadata *C.Metadata) (C.Proxy, C.Rule, error) {
} }
if metadata.NetWork == C.UDP && !adapter.SupportUDP() { if metadata.NetWork == C.UDP && !adapter.SupportUDP() {
log.Debugln("%v UDP is not supported", adapter.Name()) log.Debugln("%s UDP is not supported", adapter.Name())
continue continue
} }
return adapter, rule, nil return adapter, rule, nil