Fetch the repository succeeded.
package connection
import (
"net"
"strings"
"gitee.com/leminewx/polarisprotocol/v1/protocol"
)
type metadata struct {
LocalIp string // 本端IP
RemoteIp string // 对端IP
LocalAddr string // 本端地址
RemoteAddr string // 对端地址
LocalIdentity protocol.Identity // 本端身份
RemoteIdentity protocol.Identity // 对端身份
}
func newMetadata(conn net.Conn, localIdentity, remoteIdentity protocol.Identity) *metadata {
return &metadata{
LocalIp: strings.Split(conn.LocalAddr().String(), ":")[0],
RemoteIp: strings.Split(conn.RemoteAddr().String(), ":")[0],
LocalAddr: conn.LocalAddr().String(),
RemoteAddr: conn.RemoteAddr().String(),
LocalIdentity: localIdentity,
RemoteIdentity: remoteIdentity,
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。