im/vendor/qiniu/php-sdk/tests/socks5-server/main.go

25 lines
482 B
Go
Raw Permalink Normal View History

2023-09-26 18:09:46 +08:00
package main
import (
"log"
"os"
socks5 "github.com/armon/go-socks5"
)
func main() {
config := socks5.Config{
AuthMethods: []socks5.Authenticator{socks5.UserPassAuthenticator{Credentials: socks5.StaticCredentials{"user": "pass"}}},
Logger: log.New(os.Stderr, "", log.LstdFlags|log.LUTC|log.Lshortfile),
}
server, err := socks5.New(&config)
if err != nil {
panic(err)
}
if err = server.ListenAndServe("tcp", "127.0.0.1:8080"); err != nil {
panic(err)
}
}