fix websocket for tunnel
This commit is contained in:
@ -38,10 +38,6 @@ func Sniffing(ctx context.Context, rdw io.ReadWriter) (rw io.ReadWriter, host st
|
||||
if err == nil {
|
||||
host = r.Host
|
||||
protocol = ProtoHTTP
|
||||
|
||||
if r.Header.Get("Upgrade") == "websocket" {
|
||||
protocol = ProtoWebsocket
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -93,10 +89,9 @@ func isHTTP(s string) bool {
|
||||
}
|
||||
|
||||
const (
|
||||
ProtoHTTP = "http"
|
||||
ProtoWebsocket = "ws"
|
||||
ProtoTLS = "tls"
|
||||
ProtoSSHv2 = "SSH-2"
|
||||
ProtoHTTP = "http"
|
||||
ProtoTLS = "tls"
|
||||
ProtoSSHv2 = "SSH-2"
|
||||
)
|
||||
|
||||
func sniffProtocol(hdr []byte) string {
|
||||
|
Reference in New Issue
Block a user