summaryrefslogtreecommitdiffstats
path: root/vendor/go.mau.fi/whatsmeow/socket/constants.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-01-31 00:27:37 +0100
committerWim <wim@42.be>2022-03-20 14:57:48 +0100
commite3cafeaf9292f67459ff1d186f68283bfaedf2ae (patch)
treeb69c39620aa91dba695b3b935c6651c0fb37ce75 /vendor/go.mau.fi/whatsmeow/socket/constants.go
parente7b193788a56ee7cdb02a87a9db0ad6724ef66d5 (diff)
downloadmatterbridge-msglm-e3cafeaf9292f67459ff1d186f68283bfaedf2ae.tar.gz
matterbridge-msglm-e3cafeaf9292f67459ff1d186f68283bfaedf2ae.tar.bz2
matterbridge-msglm-e3cafeaf9292f67459ff1d186f68283bfaedf2ae.zip
Add dependencies/vendor (whatsapp)
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/socket/constants.go')
-rw-r--r--vendor/go.mau.fi/whatsmeow/socket/constants.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/vendor/go.mau.fi/whatsmeow/socket/constants.go b/vendor/go.mau.fi/whatsmeow/socket/constants.go
new file mode 100644
index 00000000..88e9a90b
--- /dev/null
+++ b/vendor/go.mau.fi/whatsmeow/socket/constants.go
@@ -0,0 +1,40 @@
+// Copyright (c) 2021 Tulir Asokan
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+// Package socket implements a subset of the Noise protocol framework on top of websockets as used by WhatsApp.
+//
+// There shouldn't be any need to manually interact with this package.
+// The Client struct in the top-level whatsmeow package handles everything.
+package socket
+
+import "errors"
+
+const (
+ // Origin is the Origin header for all WhatsApp websocket connections
+ Origin = "https://web.whatsapp.com"
+ // URL is the websocket URL for the new multidevice protocol
+ URL = "wss://web.whatsapp.com/ws/chat"
+)
+
+const (
+ NoiseStartPattern = "Noise_XX_25519_AESGCM_SHA256\x00\x00\x00\x00"
+
+ WADictVersion = 2
+ WAMagicValue = 5
+)
+
+var WAConnHeader = []byte{'W', 'A', WAMagicValue, WADictVersion}
+
+const (
+ FrameMaxSize = 2 << 23
+ FrameLengthSize = 3
+)
+
+var (
+ ErrFrameTooLarge = errors.New("frame too large")
+ ErrSocketClosed = errors.New("frame socket is closed")
+ ErrSocketAlreadyOpen = errors.New("frame socket is already open")
+)