This commit is contained in:
idk 2018-12-25 03:58:16 -05:00
parent b65cd52418
commit 8a9c747dbd
No known key found for this signature in database
GPG key ID: D75C03B39B5E14E1
2 changed files with 14 additions and 1 deletions

View file

@ -20,12 +20,21 @@ type Manager struct {
*sam3.SAM
conns []*conn.Conn
datadir string
host string
port string
samhost string
samport string
samopts []string
}
func (m Manager) Serve() error {
server, err := socks5.New(conf)
if err != nil {
return err
}
if err := server.ListenAndServe("tcp", m.host+":"+m.port); err != nil {
return err
}
return nil
}
@ -76,6 +85,8 @@ func NewManagerFromOptions(opts ...func(*Manager) error) (*Manager, error) {
m.samhost = "127.0.0.1"
m.samport = "7656"
m.datadir = "./tunnels/"
m.host = "127.0.0.1"
m.port = "7950"
for _, o := range opts {
if err := o(&m); err != nil {
return nil, err