mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
Feature: add custom headers support in v2ray-plugin (#137)
This commit is contained in:
parent
7f0c7d7802
commit
8c608f5d7a
|
@ -52,6 +52,7 @@ type v2rayObfsOption struct {
|
||||||
Host string `obfs:"host,omitempty"`
|
Host string `obfs:"host,omitempty"`
|
||||||
Path string `obfs:"path,omitempty"`
|
Path string `obfs:"path,omitempty"`
|
||||||
TLS bool `obfs:"tls,omitempty"`
|
TLS bool `obfs:"tls,omitempty"`
|
||||||
|
Headers map[string]string `obfs:"headers,omitempty"`
|
||||||
SkipCertVerify bool `obfs:"skip-cert-verify,omitempty"`
|
SkipCertVerify bool `obfs:"skip-cert-verify,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,10 +132,10 @@ func NewShadowSocks(option ShadowSocksOption) (*ShadowSocks, error) {
|
||||||
ClientSessionCache: getClientSessionCache(),
|
ClientSessionCache: getClientSessionCache(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wsOption = &v2rayObfs.WebsocketOption{
|
wsOption = &v2rayObfs.WebsocketOption{
|
||||||
Host: opts.Host,
|
Host: opts.Host,
|
||||||
Path: opts.Path,
|
Path: opts.Path,
|
||||||
|
Headers: opts.Headers,
|
||||||
TLSConfig: tlsConfig,
|
TLSConfig: tlsConfig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
type WebsocketOption struct {
|
type WebsocketOption struct {
|
||||||
Host string
|
Host string
|
||||||
Path string
|
Path string
|
||||||
|
Headers map[string]string
|
||||||
TLSConfig *tls.Config
|
TLSConfig *tls.Config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +21,7 @@ func NewWebsocketObfs(conn net.Conn, option *WebsocketOption) (net.Conn, error)
|
||||||
Host: option.Host,
|
Host: option.Host,
|
||||||
Path: option.Path,
|
Path: option.Path,
|
||||||
TLS: option.TLSConfig != nil,
|
TLS: option.TLSConfig != nil,
|
||||||
|
Headers: option.Headers,
|
||||||
TLSConfig: option.TLSConfig,
|
TLSConfig: option.TLSConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user