mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-24 14:16:06 +03:00
Config: Correctly marshal Address
to JSON (#4021)
This commit is contained in:
parent
5a96ef632d
commit
55e045d098
@ -42,6 +42,10 @@ type Address struct {
|
|||||||
net.Address
|
net.Address
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (v Address) MarshalJSON() ([]byte, error) {
|
||||||
|
return json.Marshal(v.Address.String())
|
||||||
|
}
|
||||||
|
|
||||||
func (v *Address) UnmarshalJSON(data []byte) error {
|
func (v *Address) UnmarshalJSON(data []byte) error {
|
||||||
var rawStr string
|
var rawStr string
|
||||||
if err := json.Unmarshal(data, &rawStr); err != nil {
|
if err := json.Unmarshal(data, &rawStr); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user