p2p/nat: add MarshalText in STUN

This commit is contained in:
Felix Lange 2025-01-23 15:46:32 +01:00
parent e3a166d99e
commit 9b698138e9

View file

@ -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 {