get ready for saving the keys
This commit is contained in:
parent
75d32ae82d
commit
842be5eadd
3 changed files with 8 additions and 7 deletions
5
main.go
5
main.go
|
@ -8,9 +8,8 @@ import (
|
|||
)
|
||||
|
||||
import (
|
||||
"github.com/eyedeekay/sam-forwarder/config"
|
||||
//"github.com/eyedeekay/samcatd-web"
|
||||
"github.com/eyedeekay/eeproxy/socks"
|
||||
"github.com/eyedeekay/sam-forwarder/config"
|
||||
)
|
||||
|
||||
type flagOpts []string
|
||||
|
@ -138,7 +137,7 @@ func main() {
|
|||
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt)
|
||||
if tunsocks, tunerr := tunmanager.NewManager(config.SamHost, config.SamPort, config.Print(), config.SaveDirectory); tunerr == nil {
|
||||
if tunsocks, tunerr := tunmanager.NewManager(config.SamHost, config.SamPort, config.SaveDirectory, config.Print()); tunerr == nil {
|
||||
go func() {
|
||||
for sig := range c {
|
||||
if sig == os.Interrupt {
|
||||
|
|
|
@ -53,12 +53,12 @@ func (m Manager) Dial(ctx context.Context, network, addr string) (net.Conn, erro
|
|||
return m.DialI2P(ctx, addr)
|
||||
}
|
||||
|
||||
func NewManager(samhost, samport, samopts, datadir string) (*Manager, error) {
|
||||
func NewManager(samhost, samport, datadir string, samopts []string) (*Manager, error) {
|
||||
return NewManagerFromOptions(
|
||||
SetHost(samhost),
|
||||
SetPort(samport),
|
||||
SetSAMOpts(samopts),
|
||||
SetDataDir(datadir),
|
||||
SetSAMOpts(samopts),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -40,9 +40,11 @@ func SetPort(v string) func(*Manager) error {
|
|||
}
|
||||
|
||||
//SetSAMOpts sets the SAM options
|
||||
func SetSAMOpts(s string) func(*Manager) error {
|
||||
func SetSAMOpts(s []string) func(*Manager) error {
|
||||
return func(c *Manager) error {
|
||||
c.samopts = s
|
||||
for _, i := range s {
|
||||
c.samopts += i + " "
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue