Go-whatsapp: Login connection timed out

Created on 21 Apr 2020  路  26Comments  路  Source: Rhymen/go-whatsapp

Last few hours I got "login connection timed out" error message when trying to login via session. Tried to change waVersion but still get timed out. Does anyone get this error message too?

Most helpful comment

Hai, I have some problem Connection failed code: 1000, text:. I try see web.whatsapp and I get message ws

1587435287.--0,["admin","init",[2,2013,7],["Mac OS","Chrome","10.15.4"],"xxxxxxx",true]

I try change client version to 2,2013,7 but connection timeout. And I try add client version "10.15.4" for client name and login succesfully.

So, I add variable clientVersion string in conn.go file.
In session.go file I change SetClientName function to

func (wac *Conn) SetClientName(long, short, version string) error {
    if wac.session != nil && (wac.session.EncKey != nil || wac.session.MacKey != nil) {
        return fmt.Errorf("cannot change client name after logging in")
    }
    wac.longClientName, wac.shortClientName, wac.clientVersion = long, short, version
    return nil
}

I change in Login function from code

login := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName}, session.ClientId, true}

to

login := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName, wac.clientVersion}, session.ClientId, true}

And change Restore function from

init := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName}, wac.session.ClientId, true}

to

init := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName, wac.clientVersion}, wac.session.ClientId, true}

Sorry my bad language.

All 26 comments

looks like whatsapp stopping this client. Even other clients like https://github.com/sigalor/whatsapp-web-reveng are also not working.

+1

+1

+1

+1

+1

Just a note, generating a new qr code on whatsapp-web-reveng works, but reconnect doesn't

but for me even QR code also not generating. I'm using whatsapp-web-reveng docker.

Screenshot 2020-04-21 at 8 16 34 AM

Generating QrCode with the go-whatsapp is not working either

What version are you using? I'm using [0,4,2088] and it's generating.. (whatsapp-web-reveng)

i'm using 0,4,2088 too

And running example/checkNewVersion gives a panic panic: runtime error: index out of range [0] with length 0

Current WhatsApp Web version is 2.2013.7

Guys I got it working here in whatsapp reveng, I think it will work on go as well:
Add the version to the init array like so: the important part here is: "Mac OS", "Chrome", "VERSION HERE"

1587436001.--0,["admin","init",[2,2013,7],["Mac OS","Chrome","10.15.4"],"xxxx",true]

Hai, I have some problem Connection failed code: 1000, text:. I try see web.whatsapp and I get message ws

1587435287.--0,["admin","init",[2,2013,7],["Mac OS","Chrome","10.15.4"],"xxxxxxx",true]

I try change client version to 2,2013,7 but connection timeout. And I try add client version "10.15.4" for client name and login succesfully.

So, I add variable clientVersion string in conn.go file.
In session.go file I change SetClientName function to

func (wac *Conn) SetClientName(long, short, version string) error {
    if wac.session != nil && (wac.session.EncKey != nil || wac.session.MacKey != nil) {
        return fmt.Errorf("cannot change client name after logging in")
    }
    wac.longClientName, wac.shortClientName, wac.clientVersion = long, short, version
    return nil
}

I change in Login function from code

login := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName}, session.ClientId, true}

to

login := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName, wac.clientVersion}, session.ClientId, true}

And change Restore function from

init := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName}, wac.session.ClientId, true}

to

init := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName, wac.clientVersion}, wac.session.ClientId, true}

Sorry my bad language.

Guys I got it working here in whatsapp reveng, I think it will work on go as well:
Add the version to the init array like so: the important part here is: "Mac OS", "Chrome", "VERSION HERE"

1587436001.--0,["admin","init",[2,2013,7],["Mac OS","Chrome","10.15.4"],"xxxx",true]

Thanks! It works!

Login and reconnecting process got significantly slower for me

Also need to change in session.go

init := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName}, wac.session.ClientId, true}

to

init := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName, wac.clientVersion}, wac.session.ClientId, true}

To make session restoration work

awesome

I love too

in my script i have this :

                                wac.SetClientName(longName, shortName )

it seems there is an error here wac.SetClientName(longName, shortName ) and i would pass client Virsion string ? but how ? any advice

why it dos not get it directly

wac.SetClientName("Long name", "shor Name", "10.15.14")

yes I know but why it dos not take it directly from the baselib! @x00b

yes I know but why it dos not take it directly from the baselib! @x00b

You can add default client version value in NewConn function file conn.go

wac := &Conn{
        handler:    make([]Handler, 0),
        msgCount:   0,
        msgTimeout: timeout,
        Store:      newStore(),

        longClientName:  "github.com/rhymen/go-whatsapp",
        shortClientName: "go-whatsapp",
        clientVersion:   "10.15.14",
    }

I did that already but my question is , why user has to add this value, it has to be preset in the lib.

Its was added to web.whatsapp tonight.

Thank you for your reply, I mean it would be nice if the PL has this update as well so normal users will not go through this problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Manjit2003 picture Manjit2003  路  9Comments

carloslfu picture carloslfu  路  5Comments

xnodcorp picture xnodcorp  路  3Comments

yazeed44 picture yazeed44  路  4Comments

Valdenirmezadri picture Valdenirmezadri  路  5Comments