diff --git a/main.go b/main.go index c23c4d9..ac26fa8 100644 --- a/main.go +++ b/main.go @@ -36,13 +36,14 @@ func (h *httpProxyHandler) dialOut(addr string) (net.Conn, error) { if err != nil { return nil, err } - if strings.HasSuffix(host, ".loki") { - return net.Dial("tcp", addr) + if strings.HasSuffix(host, ".onion") { + return h.onion.Dial("tcp", addr) } if strings.HasSuffix(host, ".i2p") { return h.i2p.Dial("tcp", addr) } - return h.onion.Dial("tcp", addr) + // fallthrough for clearnet and .loki + return net.Dial("tcp", addr) } func (h *httpProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { @@ -118,13 +119,14 @@ func main() { if err != nil { return nil, err } - if strings.HasSuffix(host, ".loki") { - return net.Dial("tcp", addr) + if strings.HasSuffix(host, ".onion") { + return onionsock.Dial("tcp", addr) } if strings.HasSuffix(host, ".i2p") { return i2psock.Dial("tcp", addr) } - return onionsock.Dial("tcp", addr) + // fallthrough for clearnet and loki + return net.Dial("tcp", addr) }, })