Conns aren't being saved
This commit is contained in:
parent
357e48a012
commit
4544aec918
4 changed files with 17 additions and 10 deletions
6
Makefile
6
Makefile
|
@ -35,3 +35,9 @@ kill:
|
||||||
fire:
|
fire:
|
||||||
\/usr/bin/curl --socks5-hostname 127.0.0.1:7950 http://i2p-projekt.i2p --output i2p-projekt.html
|
\/usr/bin/curl --socks5-hostname 127.0.0.1:7950 http://i2p-projekt.i2p --output i2p-projekt.html
|
||||||
\/usr/bin/curl --socks5-hostname 127.0.0.1:7950 http://inr.i2p --output inr.html
|
\/usr/bin/curl --socks5-hostname 127.0.0.1:7950 http://inr.i2p --output inr.html
|
||||||
|
|
||||||
|
tb:
|
||||||
|
go build ./conn
|
||||||
|
go build ./socks
|
||||||
|
go build ./rewriter
|
||||||
|
go build ./resolve
|
||||||
|
|
BIN
i2p-projekt.html
BIN
i2p-projekt.html
Binary file not shown.
BIN
inr.html
BIN
inr.html
Binary file not shown.
|
@ -20,7 +20,8 @@ type Manager struct {
|
||||||
socks5.Config
|
socks5.Config
|
||||||
*sam3.SAM
|
*sam3.SAM
|
||||||
listen net.Listener
|
listen net.Listener
|
||||||
conns []conn.Conn
|
server *socks5.Server
|
||||||
|
conns []*conn.Conn
|
||||||
datadir string
|
datadir string
|
||||||
host string
|
host string
|
||||||
port string
|
port string
|
||||||
|
@ -30,14 +31,7 @@ type Manager struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m Manager) Serve() error {
|
func (m Manager) Serve() error {
|
||||||
server, err := socks5.New(&m.Config)
|
if err := m.server.Serve(m.listen); err != nil {
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if m.listen, err = net.Listen("tcp", m.host+":"+m.port); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := server.Serve(m.listen); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -59,7 +53,7 @@ func (m *Manager) DialI2P(ctx context.Context, addr string) (*sam3.SAMConn, erro
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
m.conns = append(m.conns, newconn)
|
m.conns = append(m.conns, &newconn)
|
||||||
log.Println("Generated destination for address:", i2paddr.Base32(), "at position", len(m.conns)-1)
|
log.Println("Generated destination for address:", i2paddr.Base32(), "at position", len(m.conns)-1)
|
||||||
return m.conns[len(m.conns)-1].SAMConn, nil
|
return m.conns[len(m.conns)-1].SAMConn, nil
|
||||||
}
|
}
|
||||||
|
@ -118,5 +112,12 @@ func NewManagerFromOptions(opts ...func(*Manager) error) (*Manager, error) {
|
||||||
}
|
}
|
||||||
return &m, nil
|
return &m, nil
|
||||||
}
|
}
|
||||||
|
m.server, err = socks5.New(&m.Config)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if m.listen, err = net.Listen("tcp", m.host+":"+m.port); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
return nil, fmt.Errorf("Resolver creation error.")
|
return nil, fmt.Errorf("Resolver creation error.")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue