feat: add v2ray-http-upgrade support

This commit is contained in:
wwqgtxx
2023-11-02 11:11:19 +08:00
parent b0638cfc49
commit ceac5bfaa4
8 changed files with 97 additions and 49 deletions

View File

@ -12,14 +12,15 @@ import (
// Option is options of websocket obfs
type Option struct {
Host string
Port string
Path string
Headers map[string]string
TLS bool
SkipCertVerify bool
Fingerprint string
Mux bool
Host string
Port string
Path string
Headers map[string]string
TLS bool
SkipCertVerify bool
Fingerprint string
Mux bool
V2rayHttpUpgrade bool
}
// NewV2rayObfs return a HTTPObfs
@ -30,10 +31,11 @@ func NewV2rayObfs(ctx context.Context, conn net.Conn, option *Option) (net.Conn,
}
config := &vmess.WebsocketConfig{
Host: option.Host,
Port: option.Port,
Path: option.Path,
Headers: header,
Host: option.Host,
Port: option.Port,
Path: option.Path,
V2rayHttpUpgrade: option.V2rayHttpUpgrade,
Headers: header,
}
if option.TLS {