make local port selection deterministic and detach from the control port to improve performance
This commit is contained in:
parent
dd2af9f059
commit
5c98fd575b
|
@ -29,7 +29,7 @@ func SetupOnion(torControlAddress string, torControlSocketType string, authentic
|
|||
return c.NewListener(cfg, onionport)
|
||||
}
|
||||
|
||||
func SetupOnionV3(torControlAddress string, torControlSocketType string, authentication string, pk ed25519.PrivateKey, onionport uint16) (net.Listener, error) {
|
||||
func SetupOnionV3(torControlAddress string, torControlSocketType string, authentication string, pk ed25519.PrivateKey, onionstr string, onionport uint16) (net.Listener, error) {
|
||||
c, err := bulb.Dial(torControlSocketType, torControlAddress)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -56,7 +56,8 @@ func SetupOnionV3(torControlAddress string, torControlSocketType string, authent
|
|||
cfg := &bulb.NewOnionConfig{
|
||||
DiscardPK: true,
|
||||
PrivateKey: onionPK,
|
||||
Detach: true,
|
||||
}
|
||||
|
||||
return c.NewListener(cfg, onionport)
|
||||
return c.RecoverListener(cfg, onionstr, onionport)
|
||||
}
|
||||
|
|
Reference in New Issue