SocketCluster/socketcluster-client

socketCluster client on the backend

Closed this issue · 0 comments

Hi. New to node so sorry if asking a silly question but I'm trying to make a simple backend app that connects to socketcluster using the following code:

const socketCluster = import('socketcluster-client')

const options = {
    hostname: 'localhost',
    secure: false,
    port: 9000,
    rejectUnauthorized: false // Only necessary during debug if using a self-signed certificate
};
// Initiate the connection to the server
const socket = socketCluster.create(options)

then I attempt to run it using
npm index.js
And the error I get is

TypeError: socketCluster.create is not a function

Can you give some pointers on how to get this running ?