为什么简单拨号器(袜子)总是返回EOF?

get this error in any addr.

main.go

package main

import (
    "fmt"
    "os"
)

func dialSocks(socks string) (Dial proxy.Dialer, err error) {
    Dial, err = proxy.SOCKS5("tcp", socks, nil, proxy.Direct)
    return
}

func checkError(err error) {
    if err != nil {
        fmt.Fprintf(os.Stderr, "Fatal error: %s", err.Error())
        os.Exit(1)
    }
}

func main() {
    dialSocksProxy, err := dialSocks("202.79.50.167:44926")
    checkError(err)

    dialer, err := dialSocksProxy.Dial("tcp", "smtp.gmail.com:587")
    checkError(err)
}

output:

Fatal error: socks connect tcp 202.79.50.167:44926->smtp.gmail.com:587:EOF

It's because the sock5 proxy you are attempting to use is not working properly.

$> curl --socks5 202.79.50.167:44926 google.com
curl: (7) Unable to receive initial SOCKS5 response.