more integration of vpn
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user