mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
p2p/nat: add MarshalText in STUN
This commit is contained in:
parent
e3a166d99e
commit
9b698138e9
1 changed files with 6 additions and 2 deletions
|
|
@ -56,9 +56,13 @@ func newSTUN(serverAddr string) (Interface, error) {
|
||||||
|
|
||||||
func (s stun) String() string {
|
func (s stun) String() string {
|
||||||
if len(s.serverList) == 1 {
|
if len(s.serverList) == 1 {
|
||||||
return fmt.Sprintf("STUN(%s)", s.serverList[0])
|
return fmt.Sprintf("stun:%s", s.serverList[0])
|
||||||
}
|
}
|
||||||
return "STUN"
|
return "stun"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s stun) MarshalText() ([]byte, error) {
|
||||||
|
return []byte(s.String()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (stun) SupportsMapping() bool {
|
func (stun) SupportsMapping() bool {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue