change sam3 to i2pkeys in some places
This commit is contained in:
parent
a17ef742a2
commit
4ad3e7d4a0
8 changed files with 435 additions and 23 deletions
|
@ -12,7 +12,8 @@ import (
|
|||
"github.com/eyedeekay/eeproxy/resolve"
|
||||
"github.com/eyedeekay/eeproxy/rewriter"
|
||||
"github.com/eyedeekay/go-socks5"
|
||||
"github.com/eyedeekay/sam3"
|
||||
"github.com/go-i2p/sam3"
|
||||
"github.com/go-i2p/i2pkeys"
|
||||
)
|
||||
|
||||
type Manager struct {
|
||||
|
@ -59,12 +60,12 @@ func (m *Manager) generateConnection(addr string) error {
|
|||
}
|
||||
|
||||
func (m *Manager) DialI2P(ctx context.Context, addr string) (*sam3.SAMConn, error) {
|
||||
i2paddr, err := sam3.NewI2PAddrFromString(addr)
|
||||
i2paddr, err := i2pkeys.NewI2PAddrFromString(addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for i, c := range m.conns {
|
||||
if i2paddr.Base32() == c.RemoteAddr().(*sam3.I2PAddr).Base32() {
|
||||
if i2paddr.Base32() == c.RemoteAddr().(*i2pkeys.I2PAddr).Base32() {
|
||||
log.Println("Found destination for address:", i2paddr.Base32(), "at position", i)
|
||||
return c.SAMConn, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue