MCPcopy Create free account
hub / github.com/Hidden-Node/GooseRelayVPN-AndroidClient / EncodeProbePayload

Function EncodeProbePayload

internal/protocol/protocol.go:27–35  ·  view source on GitHub ↗
(clientVersion string)

Source from the content-addressed store, hash-verified

25}
26
27func EncodeProbePayload(clientVersion string) []byte {
28 probe := VersionProbe{
29 Type: "version_probe",
30 ClientVersion: clientVersion,
31 Protocol: ProtocolVersion,
32 }
33 b, _ := json.Marshal(probe)
34 return append([]byte(ProbePrefix+"|"), b...)
35}
36
37func IsProbePayload(payload []byte) bool {
38 return bytes.HasPrefix(payload, []byte(ProbePrefix+"|")) || bytes.Equal(payload, []byte(ProbePrefix))

Callers 1

DiagnoseMethod · 0.92

Calls 1

MarshalMethod · 0.80

Tested by

no test coverage detected