|
|
@@ -52,20 +52,23 @@ type connections struct {
|
|
52
|
52
|
All connectionType `json:"all"`
|
|
53
|
53
|
Abridged connectionType `json:"abridged"`
|
|
54
|
54
|
Intermediate connectionType `json:"intermediate"`
|
|
|
55
|
+ Secure connectionType `json:"secure"`
|
|
55
|
56
|
}
|
|
56
|
57
|
|
|
57
|
58
|
func (c connections) MarshalJSON() ([]byte, error) {
|
|
58
|
|
- c.All.IPv4 = c.Abridged.IPv4 + c.Intermediate.IPv4
|
|
59
|
|
- c.All.IPv6 = c.Abridged.IPv6 + c.Intermediate.IPv6
|
|
|
59
|
+ c.All.IPv4 = c.Abridged.IPv4 + c.Intermediate.IPv4 + c.Secure.IPv4
|
|
|
60
|
+ c.All.IPv6 = c.Abridged.IPv6 + c.Intermediate.IPv6 + c.Secure.IPv6
|
|
60
|
61
|
|
|
61
|
62
|
value := struct {
|
|
62
|
63
|
All connectionType `json:"all"`
|
|
63
|
64
|
Abridged connectionType `json:"abridged"`
|
|
64
|
65
|
Intermediate connectionType `json:"intermediate"`
|
|
|
66
|
+ Secure connectionType `json:"secure"`
|
|
65
|
67
|
}{
|
|
66
|
68
|
All: c.All,
|
|
67
|
69
|
Abridged: c.Abridged,
|
|
68
|
70
|
Intermediate: c.Intermediate,
|
|
|
71
|
+ Secure: c.Secure,
|
|
69
|
72
|
}
|
|
70
|
73
|
|
|
71
|
74
|
return json.Marshal(value)
|
|
|
@@ -87,13 +90,12 @@ type speed struct {
|
|
87
|
90
|
}
|
|
88
|
91
|
|
|
89
|
92
|
type stats struct {
|
|
90
|
|
- URLs config.IPURLs `json:"urls"`
|
|
91
|
|
- ActiveConnections connections `json:"active_connections"`
|
|
92
|
|
- AllConnections connections `json:"all_connections"`
|
|
93
|
|
- Traffic traffic `json:"traffic"`
|
|
94
|
|
- Speed speed `json:"speed"`
|
|
95
|
|
- Uptime uptime `json:"uptime"`
|
|
96
|
|
- Crashes uint32 `json:"crashes"`
|
|
|
93
|
+ URLs config.IPURLs `json:"urls"`
|
|
|
94
|
+ Connections connections `json:"connections"`
|
|
|
95
|
+ Traffic traffic `json:"traffic"`
|
|
|
96
|
+ Speed speed `json:"speed"`
|
|
|
97
|
+ Uptime uptime `json:"uptime"`
|
|
|
98
|
+ Crashes uint32 `json:"crashes"`
|
|
97
|
99
|
|
|
98
|
100
|
speedCurrent speed
|
|
99
|
101
|
mutex *sync.RWMutex
|