Closed wideweide closed 4 months ago
centrifuge server version: 3.2.0
Nodejs 18.16:
const Centrifuge = require('centrifuge'); const SockJS = require('sockjs-client'); const url = 'http://*.com:8213'; const centrifugoToken = '***'; const centrifuge = new Centrifuge(`${url}/centrifugo/connection/sockjs`, { transport: SockJS, sockjs: SockJS }); centrifuge.setToken(centrifugoToken); centrifuge.connect();
const { Centrifuge } = require('centrifuge'); // 3.1.2 const WebSocket = require('ws'); const centrifuge = new Centrifuge(url, { token: centrifugoToken, websocket: WebSocket, });
the console show
Connecting: 0, connect called Disconnected: 3501, bad request
server log
{"level":"info","client":"de69b4c4-a77a-400d-aa18-fb33f33ef28f","user":"","time":"2024-07-04T17:18:16+08:00","message":"client credentials not found"} {"level":"info","client":"de69b4c4-a77a-400d-aa18-fb33f33ef28f","command":"id:1 connect:{token:\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1NyIsImNoYW5uZWxzIjpbInB1YmxpYzpwbXM6Il0sImV4cCI6MTcyMDY4ODAzNn0.hZ5CnMtjK9XW5kWCl6zkNIvR9fChaVniAw8Z5y-0kKg\" name:\"js\"}","reason":"bad request","user":"","time":"2024-07-04T17:18:16+08:00","message":"disconnect after handling command"}
Hello! centrifuge-js >= v3.0.0 works only with Centrifugo v4. See https://centrifugal.dev/docs/4/getting-started/migration_v4#client-sdk-migration
centrifuge server version: 3.2.0
Nodejs 18.16:
centrifuge 2.8.5 with sockjs work well
centrifuge 3.1.2 with websokcet failed
the console show
server log