I do have to get keys from the interface

This commit is contained in:
idk
2019-06-09 23:10:29 -04:00
parent 713635d568
commit 3c99520aa7
8 changed files with 31 additions and 0 deletions

View File

@ -30,6 +30,7 @@ type Conf struct {
TargetPort string
SamHost string
SamPort string
TunnelHost string
TargetForPort443 string
TunName string
EncryptLeaseSet bool
@ -235,6 +236,7 @@ func (c *Conf) I2PINILoad(iniFile string, label ...string) error {
c.SetPort(label...)
c.SetSAMHost(label...)
c.SetSAMPort(label...)
c.SetEndpointHost(label...)
c.SetTunName(label...)
c.SetSigType(label...)
c.SetEncryptLease(label...)

View File

@ -81,6 +81,10 @@ func (f *SAMClientForwarder) ID() string {
return f.TunName
}
func (f *SAMClientForwarder) Keys() i2pkeys.I2PKeys {
return f.SamKeys
}
func (f *SAMClientForwarder) print() []string {
lsk, lspk, lspsk := f.leasesetsettings()
return []string{

View File

@ -88,6 +88,10 @@ func (f *SAMForwarder) ID() string {
return f.TunName
}
func (f *SAMForwarder) Keys() i2pkeys.I2PKeys {
return f.SamKeys
}
func (f *SAMForwarder) Cleanup() {
f.publishStream.Close()
f.publishListen.Close()

View File

@ -1,5 +1,9 @@
package samtunnel
import (
"github.com/eyedeekay/sam3/i2pkeys"
)
type SAMTunnel interface {
GetType() string
Cleanup()
@ -11,6 +15,7 @@ type SAMTunnel interface {
//Destination() string
Base32() string
Base64() string
Keys() i2pkeys.I2PKeys
Serve() error
Close() error
Up() bool

View File

@ -80,6 +80,10 @@ func (f *SAMClientForwarder) ID() string {
return f.TunName
}
func (f *SAMClientForwarder) Keys() i2pkeys.I2PKeys {
return f.SamKeys
}
func (f *SAMClientForwarder) print() []string {
lsk, lspk, lspsk := f.leasesetsettings()
return []string{

View File

@ -87,6 +87,10 @@ func (f *SAMForwarder) ID() string {
return f.TunName
}
func (f *SAMForwarder) Keys() i2pkeys.I2PKeys {
return f.SamKeys
}
func (f *SAMForwarder) Cleanup() {
f.publishStream.Close()
f.publishListen.Close()

View File

@ -82,6 +82,10 @@ func (f *SAMSSUClientForwarder) ID() string {
return f.TunName
}
func (f *SAMSSUClientForwarder) Keys() i2pkeys.I2PKeys {
return f.SamKeys
}
func (f *SAMSSUClientForwarder) Cleanup() {
f.publishConnection.Close()
f.connectStream.Close()

View File

@ -82,6 +82,10 @@ func (f *SAMSSUForwarder) ID() string {
return f.TunName
}
func (f *SAMSSUForwarder) Keys() i2pkeys.I2PKeys {
return f.SamKeys
}
func (f *SAMSSUForwarder) Cleanup() {
f.publishConnection.Close()
f.clientConnection.Close()