connString string
outgoing bool
network string
- remoteAddr net.Addr
+ RemoteAddr net.Addr
// True if the connection is operating over MSE obfuscation.
headerEncrypted bool
cryptoMethod mse.CryptoMethod
// Returns true if the connection is over IPv6.
func (cn *PeerConn) ipv6() bool {
- ip := addrIpOrNil(cn.remoteAddr)
+ ip := addrIpOrNil(cn.RemoteAddr)
if ip.To4() != nil {
return false
}
req := newRequestFromMessage(&msg)
c.onPeerSentCancel(req)
case pp.Port:
- ipa, ok := tryIpPortFromNetAddr(c.remoteAddr)
+ ipa, ok := tryIpPortFromNetAddr(c.RemoteAddr)
if !ok {
break
}
}
func (c *peer) remoteIp() net.IP {
- return addrIpOrNil(c.remoteAddr)
+ return addrIpOrNil(c.RemoteAddr)
}
func (c *peer) remoteIpPort() IpPort {
- ipa, _ := tryIpPortFromNetAddr(c.remoteAddr)
+ ipa, _ := tryIpPortFromNetAddr(c.RemoteAddr)
return IpPort{ipa.IP, uint16(ipa.Port)}
}
if c.outgoing {
f |= pp.PexOutgoingConn
}
- if c.remoteAddr != nil && strings.Contains(c.remoteAddr.Network(), "udp") {
+ if c.RemoteAddr != nil && strings.Contains(c.RemoteAddr.Network(), "udp") {
f |= pp.PexSupportsUtp
}
return f
func (c *PeerConn) dialAddr() net.Addr {
if !c.outgoing && c.PeerListenPort != 0 {
- switch addr := c.remoteAddr.(type) {
+ switch addr := c.RemoteAddr.(type) {
case *net.TCPAddr:
dialAddr := *addr
dialAddr.Port = c.PeerListenPort
return &dialAddr
}
}
- return c.remoteAddr
+ return c.RemoteAddr
}
func (c *PeerConn) pexEvent(t pexEventType) pexEvent {