tidying up code paths and making detport selection a little better
This commit is contained in:
parent
b1738ac964
commit
9c1c5ef98a
|
@ -8,13 +8,14 @@
|
||||||
package bulb
|
package bulb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto"
|
||||||
goodrand "crypto/rand"
|
goodrand "crypto/rand"
|
||||||
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"golang.org/x/crypto/sha3"
|
||||||
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
"golang.org/x/crypto/sha3"
|
|
||||||
"encoding/binary"
|
|
||||||
"crypto"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type onionAddr struct {
|
type onionAddr struct {
|
||||||
|
@ -86,6 +87,7 @@ func (c *Conn) RecoverListener(config *NewOnionConfig, onion string, vports ...u
|
||||||
if port < 1024 { // this is not uniformly random, but we don't need it to be
|
if port < 1024 { // this is not uniformly random, but we don't need it to be
|
||||||
port += 1024
|
port += 1024
|
||||||
}
|
}
|
||||||
|
log.Printf("using local port: %d\n", port)
|
||||||
var loopbackAddr = "127.0.0.1:" + strconv.Itoa(port)
|
var loopbackAddr = "127.0.0.1:" + strconv.Itoa(port)
|
||||||
|
|
||||||
// Listen on the loopback interface.
|
// Listen on the loopback interface.
|
||||||
|
|
Reference in New Issue