This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import WebSocket from 'ws' | |
// If set enableTLS to true, your have to set tlsEnabled to true in conf/websocket.conf. | |
const enableTLS = true; | |
const token = 'fake-token' | |
const topic = `${enableTLS ? 'wss' : 'ws'}://c2-pulsar-clevercloud-customers.services.clever-cloud.com:2000/ws/v2/producer/persistent/user_5db919b8-f988-4c72-a269-f8d0f62cef22/pulsar_39f5266a-b0ab-4441-a787-18f897afa796/test`; | |
const ws = new WebSocket(topic, { | |
headers: { | |
Authorization: `Bearer ${token}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Pulsar from 'pulsar-client'; | |
(async () => { | |
const token = new Pulsar.AuthenticationToken({ token: 'fake-token' }) | |
const client = new Pulsar.Client({ | |
serviceUrl: 'pulsar+ssl://c2-pulsar-clevercloud-customers.services.clever-cloud.com:2002', | |
authentication: token, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const buttonMachine = Machine({ | |
key: 'button', | |
initial: 'activated', | |
context: { | |
hasLoading: true, | |
hasSuccess: false, | |
hasFailure: false, | |
isFocused: false, | |
isMouseIn: false, | |
isKeyboardIn: false |