mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-05 01:38:24 -05:00
27 lines
520 B
Go
27 lines
520 B
Go
// +build json
|
|
|
|
package http
|
|
|
|
import (
|
|
"encoding/json"
|
|
"errors"
|
|
|
|
"github.com/v2ray/v2ray-core/proxy/internal"
|
|
)
|
|
|
|
// UnmarshalJSON implements json.Unmarshaler
|
|
func (this *Config) UnmarshalJSON(data []byte) error {
|
|
type JsonConfig struct {
|
|
}
|
|
jsonConfig := new(JsonConfig)
|
|
if err := json.Unmarshal(data, jsonConfig); err != nil {
|
|
return errors.New("HTTP: Failed to parse config: " + err.Error())
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
internal.RegisterInboundConfig("http", func() interface{} { return new(Config) })
|
|
}
|