Versions in this module Expand all Collapse all v0 v0.4.1 Oct 16, 2024 Changes in this version + var DisableTLSVerification = false type HttpQuery + Aaid string + type PushKeys struct + Auth []byte + P256DH []byte v0.4.0 Sep 16, 2024 Changes in this version + const BrowserName + const ChromeVersion + const ChromeVersionFull + const DPR + const MaxHTTPRetries + const OSName + const OSVersion + const SecCHFullVersionList + const SecCHMobile + const SecCHModel + const SecCHPlatform + const SecCHPlatformVersion + const SecCHPrefersColorScheme + const SecCHUserAgent + const UserAgent + var ErrAccountSuspended = errors.New("account suspended") + var ErrChallengeRequired = errors.New("challenge required") + var ErrChannelNotFound = fmt.Errorf("channel not found for packet") + var ErrConnectionClosed = fmt.Errorf("connection closed") + var ErrConsentRequired = errors.New("consent required") + var ErrDial = errors.New("failed to dial socket") + var ErrInReadLoop = errors.New("error in read loop") + var ErrMaxRetriesReached = errors.New("maximum retries reached") + var ErrNotAuthenticated = errors.New("messagix-socket: client has not been authenticated successfully yet") + var ErrRequestFailed = errors.New("failed to send request") + var ErrResponseReadFailed = errors.New("failed to read response body") + var ErrSendConnect = errors.New("failed to send connect packet") + var ErrSocketAlreadyOpen = errors.New("messagix-socket: socket is already open") + var ErrSocketClosed = errors.New("messagix-socket: socket is closed") + var ErrTimeout = fmt.Errorf("timeout waiting for response") + var ErrTokenInvalidated = errors.New("access token is no longer valid") + var ErrTooManyRedirects = errors.New("too many redirects") + type AckEvent interface + GetPacketId func() uint16 + type AppSettingsPublish struct + LsFdid string + SchemaVersion string + type AttributeMap map[string]string + type BBox struct + Define []*ModuleEntry + Require []*ModuleEntry + type BBoxContainer struct + BBox *BBox + type BigPipe struct + JSMods *BBox + type ChannelType int + const PacketChannel + const RequestChannel + type Client struct + Facebook *FacebookMethods + GetNewProxy func(reason string) (string, error) + Instagram *InstagramMethods + Logger zerolog.Logger + Platform types.Platform + SyncManager *SyncManager + func NewClient(cookies *cookies.Cookies, logger zerolog.Logger) *Client + func (c *Client) Connect() error + func (c *Client) Disconnect() + func (c *Client) EnableSendingMessages() + func (c *Client) ExecuteTasks(tasks ...socket.Task) (*table.LSTable, error) + func (c *Client) GetCurrentAccount() (types.UserInfo, error) + func (c *Client) GetTaskId() int + func (c *Client) IsAuthenticated() bool + func (c *Client) IsConnected() bool + func (c *Client) LoadMessagesPage() (types.UserInfo, *table.LSTable, error) + func (c *Client) MakeRequest(url string, method string, headers http.Header, payload []byte, ...) (*http.Response, []byte, error) + func (c *Client) NewHttpQuery() *HttpQuery + func (c *Client) NewMercuryMediaPayload(media *MercuryUploadMedia) ([]byte, string, error) + func (c *Client) NewPublishRequest(topic Topic, jsonData string, packetByte byte, packetId uint16) ([]byte, uint16, error) + func (c *Client) NewSubscribeRequest(topic Topic, qos packets.QoS) ([]byte, uint16, error) + func (c *Client) NewSyncManager() *SyncManager + func (c *Client) NewTaskManager() *TaskManager + func (c *Client) PrepareE2EEClient() *whatsmeow.Client + func (c *Client) RegisterE2EE(ctx context.Context, fbid int64) error + func (c *Client) SaveSession(path string) error + func (c *Client) SendMercuryUploadRequest(ctx context.Context, threadID int64, media *MercuryUploadMedia) (*types.MercuryUploadResponse, error) + func (c *Client) SetDevice(dev *store.Device) + func (c *Client) SetEventHandler(handler EventHandler) + func (c *Client) SetProxy(proxyAddr string) error + func (c *Client) UpdateProxy(reason string) bool + func (c *Client) WaitUntilCanSendMessages(timeout time.Duration) error + type Configs struct + Bitmap *crypto.Bitmap + CometReq string + CsrBitmap *crypto.Bitmap + Jazoest string + LsdToken string + VersionId int64 + WebSessionId string + func (c *Configs) LoadBitmaps() (*crypto.Bitmap, *crypto.Bitmap) + func (c *Configs) ParseFormInputs(inputs []InputTag, reflectedMs reflect.Value) + func (c *Configs) SetupConfigs(ls *table.LSTable) (*table.LSTable, error) + type Connect struct + AccountId string + Aids any + AppId int64 + Capabilities int + ChatOn bool + Cid string + ClientCapabilities int + ConnectionType string + Dc string + Fg bool + Gas any + HostNameOverride string + MqttSid string + NoAutoFg bool + P any + Pack []any + PostMessage []ConnectPostMessage + SessionId int64 + SubscribedTopics []string + UserAgent string + type ConnectPayload struct + ClientId string + ConnectFlags uint8 + JSONData string + KeepAliveTime uint16 + ProtocolLevel uint8 + ProtocolName string + func (cp *ConnectPayload) Write() ([]byte, error) + type ConnectPostMessage struct + IsBase64Publish bool + MessageID int64 + Payload string + QoS packets.QoS + Topic string + type ConnectionCode uint8 + const CONNECTION_ACCEPTED + const CONNECTION_REFUSED_BAD_USERNAME_OR_PASSWORD + const CONNECTION_REFUSED_IDENTIFIER_REJECTED + const CONNECTION_REFUSED_SERVER_UNAVAILABLE + const CONNECTION_REFUSED_UNACCEPTABLE_PROTOCOL_VERSION + const CONNECTION_REFUSED_UNAUTHORIZED + func (c ConnectionCode) Error() string + func (c ConnectionCode) IsEnum() + type EventHandler func(evt interface{}) + type Event_PermanentError struct + Err error + type Event_PingResp struct + func (e *Event_PingResp) Finish() ResponseData + func (pr *Event_PingResp) SetIdentifier(identifier uint16) + type Event_PublishACK struct + PacketId uint16 + func (pb *Event_PublishACK) Finish() ResponseData + func (pb *Event_PublishACK) GetPacketId() uint16 + func (pb *Event_PublishACK) SetIdentifier(identifier uint16) + type Event_PublishResponse struct + Data PublishResponseData + MessageIdentifier uint16 + Table *table.LSTable + Topic string + func (pb *Event_PublishResponse) Finish() ResponseData + func (pb *Event_PublishResponse) SetIdentifier(identifier uint16) + type Event_Ready struct + ConnectionCode ConnectionCode + IsNewSession bool + func (e *Event_Ready) Finish() ResponseData + func (pb *Event_Ready) SetIdentifier(identifier uint16) + type Event_Reconnected struct + type Event_SocketError struct + ConnectionAttempts int + Err error + type Event_SubscribeACK struct + PacketId uint16 + QoSLevel uint8 + func (pb *Event_SubscribeACK) Finish() ResponseData + func (pb *Event_SubscribeACK) GetPacketId() uint16 + func (pb *Event_SubscribeACK) SetIdentifier(identifier uint16) + type FacebookMethods struct + func (fb *FacebookMethods) Login(identifier, password string) (*cookies.Cookies, error) + func (fb *FacebookMethods) RegisterPushNotifications(endpoint string) error + type FormTag struct + Attributes AttributeMap + Inputs []InputTag + type HttpQuery struct + A string + AcceptOnlyEssential string + AppID string + Av string + Ccg string + CometReq string + Csr string + D string + DeviceToken string + DeviceType string + DocID string + Dpr string + Dyn string + FbAPICallerClass string + FbAPIReqFriendlyName string + FbDtsg string + Hs string + Hsi string + Jazoest string + Jssesw string + Lsd string + Mid string + PushEndpoint string + Req string + Rev string + S string + ServerTimestamps string + SpinB string + SpinR string + SpinT string + SubscriptionKeys string + User string + Variables string + type ICDCFetchResponse struct + DeviceIdentities []string + ICDCSeq int + Status int + func (ifr *ICDCFetchResponse) DeviceIdentityBytes() (deviceIdentityBytes [][32]byte, err error) + type ICDCRegisterResponse struct + ICDCSuccess bool + Product string + Status int + Type string + WADeviceID int + type InputTag struct + Attributes AttributeMap + type InstagramMethods struct + func (ig *InstagramMethods) ExtractFBID(currentUser types.UserInfo, tbl *table.LSTable) (int64, error) + func (ig *InstagramMethods) FetchHighlights(highlightIds []string) (*responses.ReelInfoResponse, error) + func (ig *InstagramMethods) FetchMedia(mediaID, mediaShortcode string) (*responses.FetchMediaResponse, error) + func (ig *InstagramMethods) FetchProfile(username string) (*responses.ProfileInfoResponse, error) + func (ig *InstagramMethods) FetchReel(reelIds []string, mediaID string) (*responses.ReelInfoResponse, error) + func (ig *InstagramMethods) Login(identifier, password string) (*cookies.Cookies, error) + func (ig *InstagramMethods) RegisterPushNotifications(endpoint string) error + type LinkTag struct + Attributes AttributeMap + type MercuryUploadMedia struct + Filename string + IsVoiceClip bool + MediaData []byte + MimeType string + WaveformData *WaveformData + type ModuleEntry struct + Data []json.RawMessage + Name string + func (me *ModuleEntry) UnmarshalJSON(data []byte) error + type ModuleParser struct + FormTags []FormTag + JSDatr string + LS *table.LSTable + LoginInputs []InputTag + func (m *ModuleParser) HandleBootloaderPayload(payload json.RawMessage, bootloaderConfig *types.BootLoaderConfig) error + func (m *ModuleParser) HandleRawJSON(data []byte, id string) error + func (m *ModuleParser) Load(page string) error + func (m *ModuleParser) SSJSHandle(data json.RawMessage) error + func (m *ModuleParser) SetClientInstance(cli *Client) + type NodeProcessor func(*html.Node) interface + type Payload interface + Write func() ([]byte, error) + type PublishPayload struct + JSONData string + PacketId uint16 + Topic Topic + func (pb *PublishPayload) Write() ([]byte, error) + type PublishResponseData struct + Payload string + RequestID int64 + Sp []string + Target int + type RPSCBBox struct + Complete bool + Result json.RawMessage + type RPSCBBoxContainer struct + BBox *RPSCBBox + type RelayPrefetchedStreamCache struct + BBox *RPSCBBoxContainer + PreloadID string + func (rpsc *RelayPrefetchedStreamCache) UnmarshalJSON(data []byte) error + type Request struct + PacketByte uint8 + RemainingLength uint32 + func (r *Request) Write(payload Payload) ([]byte, error) + type Response struct + PacketByte uint8 + RemainingLength uint32 + ResponseData ResponseData + func (r *Response) PacketType() uint8 + func (r *Response) QOS() packets.QoS + func (r *Response) Read(data []byte) error + type ResponseData interface + Finish func() ResponseData + SetIdentifier func(identifier uint16) + type ResponseHandler struct + func (p *ResponseHandler) CancelAllRequests() + type ScriptTag struct + Attributes AttributeMap + Content string + type Socket struct + func (s *Socket) BuildBrokerUrl() string + func (s *Socket) CanConnect() error + func (s *Socket) Connect() error + func (s *Socket) Disconnect() + func (s *Socket) SafePacketId() uint16 + type SocketLSRequestPayload struct + AppId string + Payload string + RequestId int + Type int + type SubscribePayload struct + PacketId uint16 + QoSLevel packets.QoS + Topic Topic + func (sb *SubscribePayload) Write() ([]byte, error) + type SyncManager struct + func (sm *SyncManager) EnsureSyncedSocket(databases []int64) error + func (sm *SyncManager) GetCursor(db int64) string + func (sm *SyncManager) SyncDataGraphQL(dbs []int64) (*table.LSTable, error) + func (sm *SyncManager) SyncSocketData(databaseId int64, db *socket.QueryMetadata) (*table.LSTable, error) + func (sm *SyncManager) SyncTransactions(transactions []*table.LSExecuteFirstBlockForSyncTransaction) error + func (sm *SyncManager) UpdateDatabaseSyncParams(dbs []*socket.QueryMetadata) error + type TaskManager struct + func (tm *TaskManager) AddNewTask(task socket.Task) + func (tm *TaskManager) FinalizePayload() ([]byte, error) + func (tm *TaskManager) GetTaskId() int64 + type Topic string + const LS_APP_SETTINGS + const LS_FOREGROUND_STATE + const LS_REQ + const LS_RESP + const UNKNOWN_TOPIC + type WaveformData struct + Amplitudes []float64 + SamplingFrequency int