From f955cc04da92a0688d96a492b11f6c9b45168c4c Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Sun, 25 Oct 2020 12:52:02 +0000 Subject: [PATCH] Fix unix socket binding if it already exists. --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index ad9dca1..e083c85 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "net/http" "net/url" "strings" + "syscall" "github.com/lucas-clemente/quic-go/http3" ) @@ -109,6 +110,7 @@ func main() { http.HandleFunc("/vi/", genericHTTPProxy) http.HandleFunc("/a/", genericHTTPProxy) http.HandleFunc("/ggpht/", genericHTTPProxy) + syscall.Unlink("http-proxy.sock") listener, err := net.Listen("unix", "http-proxy.sock") if err != nil { fmt.Println("Failed to bind to UDS, falling back to TCP/IP")