WIP
This commit is contained in:
34
peer/peer.go
34
peer/peer.go
@@ -8,17 +8,15 @@ import (
|
||||
)
|
||||
|
||||
type Peer struct {
|
||||
ip byte // Last byte of IPv4 address.
|
||||
hubAddr string
|
||||
apiKey string
|
||||
isServer bool
|
||||
isMediator bool
|
||||
encPubKey []byte
|
||||
encPrivKey []byte
|
||||
signPubKey []byte
|
||||
signPrivKey []byte
|
||||
conn *net.UDPConn
|
||||
iface io.ReadWriteCloser
|
||||
ip byte // Last byte of IPv4 address.
|
||||
hubAddr string
|
||||
apiKey string
|
||||
isServer bool
|
||||
isMediator bool
|
||||
encPubKey []byte
|
||||
encPrivKey []byte
|
||||
conn *net.UDPConn
|
||||
iface io.ReadWriteCloser
|
||||
|
||||
router *Router
|
||||
}
|
||||
@@ -30,14 +28,12 @@ func NewPeer(netName, listenIP string, port uint16) (*Peer, error) {
|
||||
}
|
||||
|
||||
peer := &Peer{
|
||||
ip: conf.PeerIP,
|
||||
hubAddr: conf.HubAddress,
|
||||
isMediator: conf.Mediator,
|
||||
apiKey: conf.APIKey,
|
||||
encPubKey: conf.EncPubKey,
|
||||
encPrivKey: conf.EncPrivKey,
|
||||
signPubKey: conf.SignPubKey,
|
||||
signPrivKey: conf.SignPrivKey,
|
||||
ip: conf.PeerIP,
|
||||
hubAddr: conf.HubAddress,
|
||||
isMediator: conf.Mediator,
|
||||
apiKey: conf.APIKey,
|
||||
encPubKey: conf.EncPubKey,
|
||||
encPrivKey: conf.EncPrivKey,
|
||||
}
|
||||
|
||||
_, peer.isServer = netip.AddrFromSlice(conf.PublicIP)
|
||||
|
||||
Reference in New Issue
Block a user