From 1748849c87c56c25518386342b3718cde5c236f3 Mon Sep 17 00:00:00 2001 From: idk Date: Fri, 26 Feb 2021 13:07:22 -0500 Subject: [PATCH] experiment: try using base32 as String in address since most things are going to expect it anyway, I think --- i2pkeys/I2PAddr.go | 4 ++-- primary.go | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/i2pkeys/I2PAddr.go b/i2pkeys/I2PAddr.go index 27dccdd..1193bb5 100644 --- a/i2pkeys/I2PAddr.go +++ b/i2pkeys/I2PAddr.go @@ -211,9 +211,9 @@ func (a I2PAddr) Base64() string { return string(a) } -// Returns the I2P destination (base64-encoded) +// Returns the I2P destination (base32-encoded) func (a I2PAddr) String() string { - return string(a) + return string(a.Base32()) } // Returns "I2P" diff --git a/primary.go b/primary.go index adfce1a..b229c53 100644 --- a/primary.go +++ b/primary.go @@ -159,7 +159,7 @@ func (sam *PrimarySession) newGenericSubSessionWithSignatureAndPorts(style, id, // Creates a new StreamSession with the I2CP- and streaminglib options as // specified. See the I2P documentation for a full list of options. -func (sam *PrimarySession) NewStreamSubSession(id string) (*StreamSession, error) { +func (sam *PrimarySession) NewStreamSubSession(id string, protocol string) (*StreamSession, error) { conn, err := sam.newGenericSubSession("STREAM", id, []string{}) if err != nil { return nil, err @@ -177,6 +177,7 @@ func (sam *PrimarySession) NewStreamSubSessionWithPorts(id, from, to string) (*S return &StreamSession{sam.Config.I2PConfig.Sam(), id, conn, sam.keys, time.Duration(600 * time.Second), time.Now(), Sig_NONE, from, to}, nil } +/* func (s *PrimarySession) I2PListener(name string) (*StreamListener, error) { listener, err := s.NewStreamSubSession(name) if err != nil { @@ -184,6 +185,7 @@ func (s *PrimarySession) I2PListener(name string) (*StreamListener, error) { } return listener.Listen() } +*/ // Creates a new datagram session. udpPort is the UDP port SAM is listening on, // and if you set it to zero, it will use SAMs standard UDP port.