From b2dff0c83110d96b8abc6d76532198cabab967f2 Mon Sep 17 00:00:00 2001 From: WendelHime <6754291+WendelHime@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:27:55 -0300 Subject: [PATCH] chore: using mismatch protocol names instead of numbers --- http_proxy.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/http_proxy.go b/http_proxy.go index 810d80ae..3c757677 100644 --- a/http_proxy.go +++ b/http_proxy.go @@ -1018,13 +1018,8 @@ func (p *Proxy) listenWATER(addr string) (net.Listener, error) { wasm = wasmBuffer.Bytes() } - mismatchProtocol, err := strconv.Atoi(p.WaterMismatchProtocol) - if err != nil { - return nil, log.Errorf("failed to parse mismatch protocol: %w", err) - } - - switch mismatchProtocol { - case 0: + switch p.WaterMismatchProtocol { + case "PROTOCOL_UNSPECIFIED": // currently the WATER listener doesn't accept a multiplexed connections, so we need to listen and accept connections directly from the listener waterListener, err := water.NewWATERListener(ctx, nil, p.WaterTransport, addr, wasm) if err != nil { @@ -1033,7 +1028,7 @@ func (p *Proxy) listenWATER(addr string) (net.Listener, error) { log.Debugf("Listening for water at %v", waterListener.Addr()) return waterListener, nil - case 97: + case "PROTOCOL_UTLS": cert, err := utls.X509KeyPair([]byte(p.CertFile), []byte(p.KeyFile)) if err != nil { return nil, log.Errorf("failed to load cert: %w", err)