more integration of vpn

This commit is contained in:
idk
2018-12-03 17:10:10 -05:00
parent 059eb57d35
commit 7ae14054a5
3 changed files with 44 additions and 44 deletions

View File

@ -11,7 +11,6 @@ import (
import (
"github.com/eyedeekay/sam-forwarder"
"github.com/eyedeekay/sam-forwarder/csvpn"
"github.com/eyedeekay/sam-forwarder/udp"
"github.com/zieckey/goini"
)
@ -478,38 +477,3 @@ func NewSAMSSUClientForwarderFromConf(config *Conf) (*samforwarderudp.SAMSSUClie
return nil, nil
}
// NewSAMVPNClientForwarderFromConfig generates a new SAMVPNForwarder from a config file
func NewSAMVPNClientForwarderFromConfig(iniFile, SamHost, SamPort string, label ...string) (*samforwardervpn.SAMClientServerVPN, error) {
if iniFile != "none" {
config, err := NewI2PTunConf(iniFile, label...)
if err != nil {
return nil, err
}
if SamHost != "" && SamHost != "127.0.0.1" && SamHost != "localhost" {
config.SamHost = config.GetSAMHost(SamHost, config.SamHost)
}
if SamPort != "" && SamPort != "7656" {
config.SamPort = config.GetSAMPort(SamPort, config.SamPort)
}
return samforwardervpn.NewSAMClientServerVPN(config)
}
return nil, nil
}
// NewSAMVPNForwarderFromConfig generates a new SAMVPNForwarder from a config file
func NewSAMVPNForwarderFromConfig(iniFile, SamHost, SamPort string, label ...string) (*samforwardervpn.SAMClientVPN, error) {
if iniFile != "none" {
config, err := NewI2PTunConf(iniFile, label...)
if err != nil {
return nil, err
}
if SamHost != "" && SamHost != "127.0.0.1" && SamHost != "localhost" {
config.SamHost = config.GetSAMHost(SamHost, config.SamHost)
}
if SamPort != "" && SamPort != "7656" {
config.SamPort = config.GetSAMPort(SamPort, config.SamPort)
}
return samforwardervpn.NewSAMClientVPN(config)
}
return nil, nil
}