Connect to PubSub

When connecting to wss://, how do you pass in credentials?

wscat -c “wss://”
connected (press CTRL+C to quit)
PASS xxx
NICK xxx

The above works for wss://, but not for What’s the right way to establish this connection?

You pass in the required credentials when you listen to a topic. See the pubsub documentation for details

Is there a way to see this working with wscat on the commandline? I’ve tried various messages (including a basic PING) from the PubSub docs and don’t receive a response.

This is how it works for PING, for anyone else needing help. wscat could not deal with the multilines I was pasting in.

wscat -c “wss://”

{ “type”: “PING”}
< { “type”: “PONG” }

Or for LISTEN to channel-subscribe-events:

{ “type”: “LISTEN”, “nonce”:“23456dghj”, “data”: { “topics”: [“channel-subscribe-events-v1.XXX”], “auth_token”: “XXX” } }
< {“type”:“RESPONSE”,“error”:“”,“nonce”:“23456dghj”}

^ Empty error means no error.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.