experiment: try using base32 as String in address since most things are going to expect it anyway, I think

This commit is contained in:
idk
2021-02-26 13:07:22 -05:00
parent 0f604e88b2
commit 1748849c87
2 changed files with 5 additions and 3 deletions

View File

@ -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"

View File

@ -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.