Merge remote-tracking branch 'clash/dev' into Meta
# Conflicts: # .github/workflows/docker.yml # dns/server.go # go.mod # go.sum # hub/executor/executor.go # test/go.mod # test/go.sum
This commit is contained in:
@ -94,7 +94,6 @@ type ProxyAdapter interface {
|
||||
// DialContext return a C.Conn with protocol which
|
||||
// contains multiplexing-related reuse logic (if any)
|
||||
DialContext(ctx context.Context, metadata *Metadata, opts ...dialer.Option) (Conn, error)
|
||||
|
||||
ListenPacketContext(ctx context.Context, metadata *Metadata, opts ...dialer.Option) (PacketConn, error)
|
||||
|
||||
// Unwrap extracts the proxy from a proxy-group. It returns nil when nothing to extract.
|
||||
|
@ -114,7 +114,7 @@ func (m *Metadata) UDPAddr() *net.UDPAddr {
|
||||
if m.NetWork != UDP || m.DstIP == nil {
|
||||
return nil
|
||||
}
|
||||
port, _ := strconv.ParseInt(m.DstPort, 10, 16)
|
||||
port, _ := strconv.ParseUint(m.DstPort, 10, 16)
|
||||
return &net.UDPAddr{
|
||||
IP: m.DstIP,
|
||||
Port: int(port),
|
||||
|
16
constant/mime/mime.go
Normal file
16
constant/mime/mime.go
Normal file
@ -0,0 +1,16 @@
|
||||
package mime
|
||||
|
||||
import (
|
||||
"mime"
|
||||
)
|
||||
|
||||
var consensusMimes = map[string]string{
|
||||
// rfc4329: text/javascript is obsolete, so we need to overwrite mime's builtin
|
||||
".js": "application/javascript; charset=utf-8",
|
||||
}
|
||||
|
||||
func init() {
|
||||
for ext, typ := range consensusMimes {
|
||||
mime.AddExtensionType(ext, typ)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user