Answer the question
In order to leave comments, you need to log in
How to set up password authentication?
I've been struggling for a couple of hours now (I don't understand how structures work well)
github.com/armon/go-socks5
I just want to set up login and password login. Judging by the lack of documentation, I can assume that a knowledgeable person will understand how to do this in a few minutes.
Thanks in advance
Answer the question
In order to leave comments, you need to log in
I guess that's how it should work.
package main
import (
"github.com/armon/go-socks5"
)
func main() {
conf := &socks5.Config{
AuthMethods: []socks5.Authenticator{
&socks5.UserPassAuthenticator{
socks5.StaticCredentials{
"username1": "password1",
"username2": "password2",
"username3": "password3",
},
},
},
}
server, err := socks5.New(conf)
if err != nil {
panic(err)
}
// Create SOCKS5 proxy on localhost port 8000
if err := server.ListenAndServe("tcp", "127.0.0.1:8000"); err != nil {
panic(err)
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question