mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-17 14:57:44 -05:00
Fix: JSON tag case (#1212)
JSON unmarshal is case insensitive in Golang
This commit is contained in:
parent
8f429c35cb
commit
5794a97708
@ -139,7 +139,6 @@ func (c *TCPConfig) Build() (proto.Message, error) {
|
|||||||
|
|
||||||
type WebSocketConfig struct {
|
type WebSocketConfig struct {
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Path2 string `json:"Path"` // The key was misspelled. For backward compatibility, we have to keep track the old key.
|
|
||||||
Headers map[string]string `json:"headers"`
|
Headers map[string]string `json:"headers"`
|
||||||
AcceptProxyProtocol bool `json:"acceptProxyProtocol"`
|
AcceptProxyProtocol bool `json:"acceptProxyProtocol"`
|
||||||
MaxEarlyData int32 `json:"maxEarlyData"`
|
MaxEarlyData int32 `json:"maxEarlyData"`
|
||||||
@ -150,9 +149,6 @@ type WebSocketConfig struct {
|
|||||||
// Build implements Buildable.
|
// Build implements Buildable.
|
||||||
func (c *WebSocketConfig) Build() (proto.Message, error) {
|
func (c *WebSocketConfig) Build() (proto.Message, error) {
|
||||||
path := c.Path
|
path := c.Path
|
||||||
if path == "" && c.Path2 != "" {
|
|
||||||
path = c.Path2
|
|
||||||
}
|
|
||||||
header := make([]*websocket.Header, 0, 32)
|
header := make([]*websocket.Header, 0, 32)
|
||||||
for key, value := range c.Headers {
|
for key, value := range c.Headers {
|
||||||
header = append(header, &websocket.Header{
|
header = append(header, &websocket.Header{
|
||||||
@ -385,12 +381,11 @@ func (p TransportProtocol) Build() (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SocketConfig struct {
|
type SocketConfig struct {
|
||||||
Mark int32 `json:"mark"`
|
Mark int32 `json:"mark"`
|
||||||
TFO *bool `json:"tcpFastOpen"`
|
TFO *bool `json:"tcpFastOpen"`
|
||||||
TProxy string `json:"tproxy"`
|
TProxy string `json:"tproxy"`
|
||||||
AcceptProxyProtocol bool `json:"acceptProxyProtocol"`
|
AcceptProxyProtocol bool `json:"acceptProxyProtocol"`
|
||||||
|
TCPKeepAliveInterval int32 `json:"tcpKeepAliveInterval"`
|
||||||
TCPKeepAliveInterval int32 `json:"tcpKeepAliveInterval"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build implements Buildable.
|
// Build implements Buildable.
|
||||||
|
Loading…
Reference in New Issue
Block a user