Change folder of unix socket.
This commit is contained in:
parent
47e88064a1
commit
2fe47dd911
1 changed files with 4 additions and 2 deletions
6
main.go
6
main.go
|
@ -7,6 +7,7 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
@ -110,8 +111,9 @@ func main() {
|
||||||
http.HandleFunc("/vi/", genericHTTPProxy)
|
http.HandleFunc("/vi/", genericHTTPProxy)
|
||||||
http.HandleFunc("/a/", genericHTTPProxy)
|
http.HandleFunc("/a/", genericHTTPProxy)
|
||||||
http.HandleFunc("/ggpht/", genericHTTPProxy)
|
http.HandleFunc("/ggpht/", genericHTTPProxy)
|
||||||
syscall.Unlink("http-proxy.sock")
|
socket := "socket" + string(os.PathSeparator) + "http-proxy.sock"
|
||||||
listener, err := net.Listen("unix", "http-proxy.sock")
|
syscall.Unlink(socket)
|
||||||
|
listener, err := net.Listen("unix", socket)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed to bind to UDS, falling back to TCP/IP")
|
fmt.Println("Failed to bind to UDS, falling back to TCP/IP")
|
||||||
fmt.Println(err.Error())
|
fmt.Println(err.Error())
|
||||||
|
|
Loading…
Add table
Reference in a new issue