@@ -62,133 +62,134 @@ var (
62
62
63
63
// When frpc start, client send this message to login to server.
64
64
type Login struct {
65
- Version string `json:"version"`
66
- Hostname string `json:"hostname"`
67
- Os string `json:"os"`
68
- Arch string `json:"arch"`
69
- User string `json:"user"`
70
- PrivilegeKey string `json:"privilege_key"`
71
- Timestamp int64 `json:"timestamp"`
72
- RunID string `json:"run_id"`
73
- Metas map [string ]string `json:"metas"`
65
+ Version string `json:"version,omitempty "`
66
+ Hostname string `json:"hostname,omitempty "`
67
+ Os string `json:"os,omitempty "`
68
+ Arch string `json:"arch,omitempty "`
69
+ User string `json:"user,omitempty "`
70
+ PrivilegeKey string `json:"privilege_key,omitempty "`
71
+ Timestamp int64 `json:"timestamp,omitempty "`
72
+ RunID string `json:"run_id,omitempty "`
73
+ Metas map [string ]string `json:"metas,omitempty "`
74
74
75
75
// Some global configures.
76
- PoolCount int `json:"pool_count"`
76
+ PoolCount int `json:"pool_count,omitempty "`
77
77
}
78
78
79
79
type LoginResp struct {
80
- Version string `json:"version"`
81
- RunID string `json:"run_id"`
82
- ServerUDPPort int `json:"server_udp_port"`
83
- Error string `json:"error"`
80
+ Version string `json:"version,omitempty "`
81
+ RunID string `json:"run_id,omitempty "`
82
+ ServerUDPPort int `json:"server_udp_port,omitempty "`
83
+ Error string `json:"error,omitempty "`
84
84
}
85
85
86
86
// When frpc login success, send this message to frps for running a new proxy.
87
87
type NewProxy struct {
88
- ProxyName string `json:"proxy_name"`
89
- ProxyType string `json:"proxy_type"`
90
- UseEncryption bool `json:"use_encryption"`
91
- UseCompression bool `json:"use_compression"`
92
- Group string `json:"group"`
93
- GroupKey string `json:"group_key"`
94
- Metas map [string ]string `json:"metas"`
88
+ ProxyName string `json:"proxy_name,omitempty "`
89
+ ProxyType string `json:"proxy_type,omitempty "`
90
+ UseEncryption bool `json:"use_encryption,omitempty "`
91
+ UseCompression bool `json:"use_compression,omitempty "`
92
+ Group string `json:"group,omitempty "`
93
+ GroupKey string `json:"group_key,omitempty "`
94
+ Metas map [string ]string `json:"metas,omitempty "`
95
95
96
96
// tcp and udp only
97
- RemotePort int `json:"remote_port"`
97
+ RemotePort int `json:"remote_port,omitempty "`
98
98
99
99
// http and https only
100
- CustomDomains []string `json:"custom_domains"`
101
- SubDomain string `json:"subdomain"`
102
- Locations []string `json:"locations"`
103
- HTTPUser string `json:"http_user"`
104
- HTTPPwd string `json:"http_pwd"`
105
- HostHeaderRewrite string `json:"host_header_rewrite"`
106
- Headers map [string ]string `json:"headers"`
100
+ CustomDomains []string `json:"custom_domains,omitempty"`
101
+ SubDomain string `json:"subdomain,omitempty"`
102
+ Locations []string `json:"locations,omitempty"`
103
+ HTTPUser string `json:"http_user,omitempty"`
104
+ HTTPPwd string `json:"http_pwd,omitempty"`
105
+ HostHeaderRewrite string `json:"host_header_rewrite,omitempty"`
106
+ Headers map [string ]string `json:"headers,omitempty"`
107
+ RouteByHTTPUser string `json:"route_by_http_user,omitempty"`
107
108
108
109
// stcp
109
- Sk string `json:"sk"`
110
+ Sk string `json:"sk,omitempty "`
110
111
111
112
// tcpmux
112
- Multiplexer string `json:"multiplexer"`
113
+ Multiplexer string `json:"multiplexer,omitempty "`
113
114
}
114
115
115
116
type NewProxyResp struct {
116
- ProxyName string `json:"proxy_name"`
117
- RemoteAddr string `json:"remote_addr"`
118
- Error string `json:"error"`
117
+ ProxyName string `json:"proxy_name,omitempty "`
118
+ RemoteAddr string `json:"remote_addr,omitempty "`
119
+ Error string `json:"error,omitempty "`
119
120
}
120
121
121
122
type CloseProxy struct {
122
- ProxyName string `json:"proxy_name"`
123
+ ProxyName string `json:"proxy_name,omitempty "`
123
124
}
124
125
125
126
type NewWorkConn struct {
126
- RunID string `json:"run_id"`
127
- PrivilegeKey string `json:"privilege_key"`
128
- Timestamp int64 `json:"timestamp"`
127
+ RunID string `json:"run_id,omitempty "`
128
+ PrivilegeKey string `json:"privilege_key,omitempty "`
129
+ Timestamp int64 `json:"timestamp,omitempty "`
129
130
}
130
131
131
132
type ReqWorkConn struct {
132
133
}
133
134
134
135
type StartWorkConn struct {
135
- ProxyName string `json:"proxy_name"`
136
- SrcAddr string `json:"src_addr"`
137
- DstAddr string `json:"dst_addr"`
138
- SrcPort uint16 `json:"src_port"`
139
- DstPort uint16 `json:"dst_port"`
140
- Error string `json:"error"`
136
+ ProxyName string `json:"proxy_name,omitempty "`
137
+ SrcAddr string `json:"src_addr,omitempty "`
138
+ DstAddr string `json:"dst_addr,omitempty "`
139
+ SrcPort uint16 `json:"src_port,omitempty "`
140
+ DstPort uint16 `json:"dst_port,omitempty "`
141
+ Error string `json:"error,omitempty "`
141
142
}
142
143
143
144
type NewVisitorConn struct {
144
- ProxyName string `json:"proxy_name"`
145
- SignKey string `json:"sign_key"`
146
- Timestamp int64 `json:"timestamp"`
147
- UseEncryption bool `json:"use_encryption"`
148
- UseCompression bool `json:"use_compression"`
145
+ ProxyName string `json:"proxy_name,omitempty "`
146
+ SignKey string `json:"sign_key,omitempty "`
147
+ Timestamp int64 `json:"timestamp,omitempty "`
148
+ UseEncryption bool `json:"use_encryption,omitempty "`
149
+ UseCompression bool `json:"use_compression,omitempty "`
149
150
}
150
151
151
152
type NewVisitorConnResp struct {
152
- ProxyName string `json:"proxy_name"`
153
- Error string `json:"error"`
153
+ ProxyName string `json:"proxy_name,omitempty "`
154
+ Error string `json:"error,omitempty "`
154
155
}
155
156
156
157
type Ping struct {
157
- PrivilegeKey string `json:"privilege_key"`
158
- Timestamp int64 `json:"timestamp"`
158
+ PrivilegeKey string `json:"privilege_key,omitempty "`
159
+ Timestamp int64 `json:"timestamp,omitempty "`
159
160
}
160
161
161
162
type Pong struct {
162
- Error string `json:"error"`
163
+ Error string `json:"error,omitempty "`
163
164
}
164
165
165
166
type UDPPacket struct {
166
- Content string `json:"c"`
167
- LocalAddr * net.UDPAddr `json:"l"`
168
- RemoteAddr * net.UDPAddr `json:"r"`
167
+ Content string `json:"c,omitempty "`
168
+ LocalAddr * net.UDPAddr `json:"l,omitempty "`
169
+ RemoteAddr * net.UDPAddr `json:"r,omitempty "`
169
170
}
170
171
171
172
type NatHoleVisitor struct {
172
- ProxyName string `json:"proxy_name"`
173
- SignKey string `json:"sign_key"`
174
- Timestamp int64 `json:"timestamp"`
173
+ ProxyName string `json:"proxy_name,omitempty "`
174
+ SignKey string `json:"sign_key,omitempty "`
175
+ Timestamp int64 `json:"timestamp,omitempty "`
175
176
}
176
177
177
178
type NatHoleClient struct {
178
- ProxyName string `json:"proxy_name"`
179
- Sid string `json:"sid"`
179
+ ProxyName string `json:"proxy_name,omitempty "`
180
+ Sid string `json:"sid,omitempty "`
180
181
}
181
182
182
183
type NatHoleResp struct {
183
- Sid string `json:"sid"`
184
- VisitorAddr string `json:"visitor_addr"`
185
- ClientAddr string `json:"client_addr"`
186
- Error string `json:"error"`
184
+ Sid string `json:"sid,omitempty "`
185
+ VisitorAddr string `json:"visitor_addr,omitempty "`
186
+ ClientAddr string `json:"client_addr,omitempty "`
187
+ Error string `json:"error,omitempty "`
187
188
}
188
189
189
190
type NatHoleClientDetectOK struct {
190
191
}
191
192
192
193
type NatHoleSid struct {
193
- Sid string `json:"sid"`
194
+ Sid string `json:"sid,omitempty "`
194
195
}
0 commit comments